Giter VIP home page Giter VIP logo

Comments (13)

x13machine avatar x13machine commented on June 22, 2024

also how would I get the angle of 2 hyperbolic points?

from hyperbolic-canvas.

ItsNickBarry avatar ItsNickBarry commented on June 22, 2024

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.

x13machine avatar x13machine commented on June 22, 2024

Math.atan2(x0-x1,y0-y1) <-- whatever the hyperbolic equivalent of that is

from hyperbolic-canvas.

ItsNickBarry avatar ItsNickBarry commented on June 22, 2024

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.

x13machine avatar x13machine commented on June 22, 2024

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.

x13machine avatar x13machine commented on June 22, 2024

do you know how I would do this?

from hyperbolic-canvas.

ItsNickBarry avatar ItsNickBarry commented on June 22, 2024

I've added a function for this.
Point.angleTo(otherPoint)
Let me know if you find errors.

from hyperbolic-canvas.

x13machine avatar x13machine commented on June 22, 2024

https://github.com/ItsNickBarry/hyperbolic-canvas/blob/gh-pages/lib/Circle.js#L26 is this correct?

from hyperbolic-canvas.

x13machine avatar x13machine commented on June 22, 2024

nevermind.

from hyperbolic-canvas.

x13machine avatar x13machine commented on June 22, 2024

seems to be correct

from hyperbolic-canvas.

x13machine avatar x13machine commented on June 22, 2024

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.

ItsNickBarry avatar ItsNickBarry commented on June 22, 2024

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.
angleto

from hyperbolic-canvas.

x13machine avatar x13machine commented on June 22, 2024

I fucked up while converting your code to rust.

from hyperbolic-canvas.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.