Comments (15)
What do you mean by "self.distance"?
from hyperbolic-canvas.
I meant var point = Point.givenHyperbolicPolarCoordinates(this.distanceFromCenter() - distance,this.distanceFromCenter() > distance?thisAngle:angle);
//there's a bug when you do something like this with the current code:
p1.distantPoint(200.0,Math.PI).distantPoint(100.0,0.0);
// or something like this
p1.distantPoint(100.0,0.0).distantPoint(200.0,Math.PI);
from hyperbolic-canvas.
I was converting your code and changing it and there was a bug like that.
from hyperbolic-canvas.
https://github.com/ItsNickBarry/hyperbolic-canvas/blob/gh-pages/lib/Line.js#L82 There's a useless Math.abs()
from hyperbolic-canvas.
Ha, looks like both calls to Math.abs() are useless. Fixed with dfc35ec.
from hyperbolic-canvas.
now fix the first bug. This library is poorly designed
from hyperbolic-canvas.
This library should use polar coordinates for the coordinates instead of poincare coordinates because like all the algorithms are converting back and forth all the time. Using Polar Coordinates instead of Poincaire Coordinates would increase performance.
from hyperbolic-canvas.
I'm working on it. Your suggested solution doesn't work any better.
I'm not sure how using polar coordinates would help with this. It's a hyperbolic library, so it's going to have hyperbolic calculations. Can you be more specific, or provide documentation?
from hyperbolic-canvas.
https://github.com/ItsNickBarry/hyperbolic-canvas/blob/gh-pages/lib/Point.js#L29
distantPoint basically does poincare coordinates -> polar coordinates -> math -> polar coordinates -> poincare coordinates.
from hyperbolic-canvas.
A bunch of functions are like that
from hyperbolic-canvas.
There would be a performance increase because the library wouldn't be converting poincare coordinates and polar coordinates all the time. just only at render time
from hyperbolic-canvas.
When you say "Poincare" coordinates, do you mean "Euclidean"?
from hyperbolic-canvas.
I think. I dunno whatever new Point({x:0.5,y:0.5}) uses.
from hyperbolic-canvas.
Yes, those are the Euclidean coordinates. You do have a point about the performance issues, and I'll work on that when I have a chance. For now, I will prioritize the issues with distantPoint.
from hyperbolic-canvas.
I'm not entirely sure what your original problem was, but I've fixed a problem that occurred when using polar coordinates with a negative radius.
All of the classes now store their instance variables privately: this._x
instead of this.x
. These variables should be retrieved using the new getter methods: this.getX()
.
When appropriate, these variables are not calculated until the getter is called. This includes the x and y coordinates of a Point.
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
- 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.