-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segment: also use dot product test for contains #13314
Conversation
This should be more robust especially if Floats are supported in the future. Check dot products before collinearity for possible efficiency improvement (not quanitified). The triangle inequality approach (added in a previous commit) is still here, but commented out until we find an example where it is needed.
According to the tests,
should be False. Whereas I might've thought
If this is how it is supposed to work, I cannot swap the order of the collinearity test and the dot prod tests... |
I would also have expected that |
Leave a comment as to why.
I think this was what the change in a previous commit [1] had in mind when changing from dot prod test to triangle ineq. [1] c5f0b00
37bbe98
to
cbaa524
Compare
I reverted my swap. And I found a new test for the triangle inequality stuff. So I figure we can either: (a) cherry-pick the test only to master: 0da2db5 (b) discuss whether adding back the dot prod test is desirable (this PR). Thoughts? |
Unfortunately sympy matrices assume symbols are different form other values in a matrix, so I knew there was some reason I used the triangle inequality, and it looks like complex symbols were it! The relationship between complex numbers and the geometry module seems weird at the moment. If a point is initialized with symbols, should those symbols be recast with the |
I don't know enough about the |
To say that a point |
@cbm755 Any updates on this? |
>>> u, v, w, z = symbols('u, v, w, z')
>>> l = Segment(Point(u, w), Point(v, z))
>>> p = Point(2*u/3 + v/3, 2*w/3 + z/3)
>>> l.contains(p)
True The above depicts that the tests in this PR pass on |
This is coming from discussion in #13302 .
This currently fails at least one slow test. So just RFC for now. CC @jksuom, @siefkenj, for discussion.