-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Improved Code for Segments Intersect #11553
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3f2ec33
added function to check if a point lies on a segment
TarasKuzyo f1efaaa
check if collinear segments have common points in segments_intersect
TarasKuzyo e0bcb64
test cases added for Path.intersects_path
TarasKuzyo 48aea1a
PEP8 check
TarasKuzyo 3bfebfb
added a test case for a range of slopes of intersecting paths
TarasKuzyo 45a25e9
changed the way segments are compared provided their slopes and inter…
TarasKuzyo 196a277
typo fix
TarasKuzyo aaff396
simplified logic of segments_intersect when handling the infinite slo…
TarasKuzyo 7f80cc9
:Merge branch 'master' into segments-intersect
TarasKuzyo dab359b
implemented isclose for path intersect check; added more test cases
TarasKuzyo fe91a6d
removed debug include
TarasKuzyo 2320585
flake8 fixes
TarasKuzyo 90b45e7
Merge branch 'segments-intersect' of https://github.com/TarasKuzyo/ma…
TarasKuzyo b6ff77e
typo fix
timhoffm 3344d13
reduced the number of checks to 30 angles and 4 eps values
TarasKuzyo 293e5fa
Merge branch 'segments-intersect' of https://github.com/TarasKuzyo/ma…
TarasKuzyo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks better to me, though I didn't check your math. Note that you could just have the one return statement using y only if you wanted it all to be more elegant. Thanks for sticking with this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we can use
y
's only because of the same reasoning why we cannot use onlyx
's.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
intercept == 0
, it doesn't matter if you check y or x, everything is on the same line...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the
intercept == 0
, we excludedx = const
lines, but if we replacex
's withy
's in the return statement the code will fail fory = const
lines.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, OK, fair enough... Thanks!