Git Product home page Git Product logo

Comments (5)

dmitru avatar dmitru commented on July 30, 2024

I second that; having ellipse (and perhaps a rectangle) would be very useful!

from flatten-js.

mathedu4all avatar mathedu4all commented on July 30, 2024

I think we can get ellipse by transform a circle by affine matrix.

from flatten-js.

alexbol99 avatar alexbol99 commented on July 30, 2024

@mathedu4all , transform circle gives ellipse in mathematics, but unfortunately not in this library.
In order to support ellipse I need an object that represent ellipse with two radii rx, ry. Then I need to implement at least the common methods like distance, intersection, relation and transformation. Not so trivial task.

from flatten-js.

edemaine avatar edemaine commented on July 30, 2024

I'm not sure, but if implementing ellipses, it might make sense to try to support arbitrary conics. At least, I think a lot of the math is similar between them, and other conics can be useful to work with. (For example, parabolas come up naturally in some computational geometry like the medial axis.) Even within ellipses, it could be nice to support arbitrary rotation (two foci not necessarily horizontally or vertically aligned). I agree that this is a nontrivial task, but maybe we can aim for it someday. 😅

Then again, axis-aligned ellipses are directly supported by SVG, so maybe that should be the first goal.

from flatten-js.

alexbol99 avatar alexbol99 commented on July 30, 2024

I agree, it would be great to support all conic curves, maybe not in the scope of this library.
Even drawing of these curves is not supported neither by SVG nor by Canvas API.

from flatten-js.

Related Issues (20)

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.