Giter VIP home page Giter VIP logo

Comments (5)

jan-mue avatar jan-mue commented on July 30, 2024 1

It is implemented but you have to use the intersect method of the Quadric/Cylinder class which returns a list of points instead of the single point/subspace that meet returns. This code should work:

c = Cylinder()
l = Line(Point(2, 2, 2), Point(3, 3, 3))
print(c.intersect(l))

I'll close this issue but please let me know if you have any more questions.

from geometer.

jan-mue avatar jan-mue commented on July 30, 2024 1

Thank you. One more question: what is the recommended test for a point in infinity, which is returned when there is no intersection?

Points at infinity are exactly those that have a zero in their last coordinate. For convenience I added the property isinf to the Point class that checks if the last coordinate is close to zero.

from geometer.

jan-mue avatar jan-mue commented on July 30, 2024 1

Which is the last coordinate? This snippet:

c = Cylinder()
l = Line(Point(3, 3, 2), Point(3, 3, 3))
print(c.intersect(l))

produces:

[Point(0j, 0j, (-0.7276068751089989+0.6859943405700353j)) at Infinity]

with non-zero last coordinate.

The last coordinate is not shown in the standard string representation of a point. Instead "at Infinity" is added when it is close to zero. You can see all the homogeneous coordinates like this: print(c.intersect(l)[0].array). You can also directly access the last coordinate like this: print(c.intersect(l)[0][-1]).

from geometer.

pauljurczak avatar pauljurczak commented on July 30, 2024

Thank you. One more question: what is the recommended test for a point in infinity, which is returned when there is no intersection?

from geometer.

pauljurczak avatar pauljurczak commented on July 30, 2024

Which is the last coordinate? This snippet:

c = Cylinder()
l = Line(Point(3, 3, 2), Point(3, 3, 3))
print(c.intersect(l))

produces:

[Point(0j, 0j, (-0.7276068751089989+0.6859943405700353j)) at Infinity]

with non-zero last coordinate.

from geometer.

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.