Comments (5)
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.
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.
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.
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.
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)
- Line.perpindicular() fails HOT 2
- Line.contains() fails HOT 2
- release with updated numpy dependency version HOT 2
- Synergies HOT 1
- Unable to install the package. SSL problem HOT 1
- [clarification] What are the intended uses of this package? HOT 1
- Issues with small angle calculations HOT 3
- Failure to transform cuboid HOT 2
- Failure to determine intersections after rotation HOT 1
- ValueError thrown during intersection between rectangle and segment HOT 1
- Other Backends HOT 1
- Help using Circles intersection HOT 1
- Segment x Line intersection HOT 1
- Rectangle vertex order matters HOT 1
- Cannot run example in Readme: 'PointCollection' is not defined HOT 1
- Point to Line distance error HOT 1
- Sphere intersection error HOT 2
- numerical instability HOT 2
- another numerical instability HOT 11
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 geometer.