Comments (13)
also how would I get the angle of 2 hyperbolic points?
from hyperbolic-canvas.
There was a small error in the function. It should be fixed now. Thanks for pointing it out.
I'm not sure what you mean by your second question.
from hyperbolic-canvas.
Math.atan2(x0-x1,y0-y1) <-- whatever the hyperbolic equivalent of that is
from hyperbolic-canvas.
I'm not sure what Math.atan2(x0-x1,y0-y1)
means in a Euclidean sense. However, it is my understanding that, because the Poincaré disk model is a "conformal mapping," angles may be measured using Euclidean logic. No conversion is necessary for angles.
from hyperbolic-canvas.
Math.atan2(x0-x1,y0-y1) gets the angle of:
var x1=x0+Math.sin(angle) * distance
var y1=y0+Math.cos(angle) * distance
from hyperbolic-canvas.
do you know how I would do this?
from hyperbolic-canvas.
I've added a function for this.
Point.angleTo(otherPoint)
Let me know if you find errors.
from hyperbolic-canvas.
https://github.com/ItsNickBarry/hyperbolic-canvas/blob/gh-pages/lib/Circle.js#L26 is this correct?
from hyperbolic-canvas.
nevermind.
from hyperbolic-canvas.
seems to be correct
from hyperbolic-canvas.
is Point.angleTo(otherPoint) suppose to get the angle is hyperbolic space? It doesn't seems to work. I converted the code into rust because javascript is to slow. My rust version doesn't get the correct angle.
from hyperbolic-canvas.
The hyperbolic line between point A and point B is represented by an arc of circle C. A.angleTo(B)
should return the angle of the slope of the line tangent to C at A, in the direction of B.
In this example, A is (.5, -.5) and B is (.5, .5). The result of A.angleTo(B)
is 2.0344439357957023. This is the angle of the shown tangent segment to the arc, the angle towards B from A.
from hyperbolic-canvas.
I fucked up while converting your code to rust.
from hyperbolic-canvas.
Related Issues (12)
- Polygons not rendering correctly HOT 2
- how would I divide a polygon to triangles? HOT 4
- are hexagon tessellations possible in hyperbolic geometry? HOT 11
- Range Error: Maximum Call Stack Size Exceeded in Point.js [not a bug] HOT 15
- [Question] How to deal with polar coordinates? HOT 2
- Are the units off? HOT 10
- rendering bug when I add fancy graphics HOT 33
- bug: polygons can't have a vertex of (0,0) HOT 1
- math problem with wrap around HOT 3
- Line object is too vague HOT 1
- distantPoint problem HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyperbolic-canvas.