Giter VIP home page Giter VIP logo

Comments (2)

ItsNickBarry avatar ItsNickBarry commented on July 21, 2024 1

Hey,

I am not a mathematician, and it's been a few years since I've worked with the underlying mathematics of this library, so the best I can do is answer your questions with code.

I recommend that you reverse engineer the examples below if you want to derive a formula, or ask a question on Mathematics Stack Exchange if you need a more detailed answer.

Answer 1

You can generate a Point object using hyperbolic polar coordinates, then use the instance functions to derive euclidean properties:

// define using hyperbolic polar coordinates
let point = Point.givenHyperbolicPolarCoordinates(r, φ);
// convert to euclidean coordinates using instance methods
let x = point.getX();
let y = point.getY();

Answer 2

let angle = P1.hyperbolicAngleTo(P2);
let distance = P1.hyperbolicDistanceTo(P2);

let P3 = P1.hyperbolicDistantPoint(k * distance, angle);

Answer 3

To get the points P(k) along L2:

let Pk = Q.hyperbolicDistantPoint(k, 0);

It looks like I need to add a function to conveniently generate L2, but for now you can do this:

// k is any nonzero real number (though should be "small" to comply with javascript limitations; ex: k = 1)
let L2 = Line,givenTwoPoints(Q, Q.hyperbolicDistantPoint(k, 0));

from hyperbolic-canvas.

nemanjajovanovic97 avatar nemanjajovanovic97 commented on July 21, 2024

Nice, thank you. I'll give it a try.

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.