Comments (10)
The radius provided to Polygon.fromNCenterRadius is a hyperbolic distance. Each vertex of the generated Polygon is that distance away from the provided center point. In this model of the hyperbolic plane, the edge of the unit circle represents a point at infinity, so any distance < infinity will fit within the circle.
Does that make sense?
I haven't decided yet whether I will include functions to create Euclidean polygons.
from hyperbolic-canvas.
Actually, that's not entirely true. Polygon.fromVertices can be used to define polygons using Euclidean points. Polygon.fromNCenterRadius is used to generate regular polygons on the hyperbolic plane.
from hyperbolic-canvas.
so is (1,1) like (infinity,infinity) in hyperbolic space
from hyperbolic-canvas.
Sort of. I'm not aware of any hyperbolic coordinate system, but (1,1) is an infinite distance away from (0,0).
from hyperbolic-canvas.
does hyperbolic-canvas use some sort of hyperbolic coordinate system?
from hyperbolic-canvas.
No. The Points are defined with standard coordinates relative to the unit circle. Given two Points, hyperbolic straight lines can be drawn, and hyperbolic distances can be calculated. Given one Point, a second Point, a specified hyperbolic distance away in a specified direction, can be found.
When generating Points, it might be more intuitive to use the Point.fromPolarCoordinates and Point.fromHyperbolicPolarCoordinates factory methods.
from hyperbolic-canvas.
on a pseudo-hyperbolic-coordinate system what would (0.5,0.5) be? how would you convert from the Euclidean-coordinate system to the pseudo-hyperbolic-coordinate
from hyperbolic-canvas.
I don't know. As far as the canvas is concerned, (.5, .5) is just (.5, .5). You can get more information about the nature of the point, in a hyperbolic sense, from the instance functions.
var point = Point.fromCoordinates(.5, .5);
// get hyperbolic distance from center
var distance = point.distanceFromCenter();
// get angle of point relative the unit circle
var angle = point.angle();
// regenerate the same point using hyperbolic information (though point.equals(newPoint) might be false due to floating point rounding error
var newPoint = Point.fromHyperbolicPolarCoordinates(distance, angle);
from hyperbolic-canvas.
I figured that I could use 2 * Math.atanh(a) and Math.tanh(a/2) to convert between them.
from hyperbolic-canvas.
I use 2 * Math.atanh(a) to calculate Point.distanceFromCenter, where a is the Euclidean distance from the center.
Math.tanh(a/2), where a is the hyperbolic distance from the center, would return the Euclidean distance from the center.
This is useful, but I don't believe it can be used to generate any sort of (x, y) coordinates. In the Cartesian coordinate system, x and y represent distances from the y and x axes, respectively. On the hyperbolic plane, I don't think distance from an axis and distance from the center can be calculated in the same way.
I could be wrong. I'll look into it.
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
- 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
- how would I check if hyperbolic 2 lines intersect? HOT 13
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.