-
Notifications
You must be signed in to change notification settings - Fork 893
Updated inPolygon
#81
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
Updated inPolygon
#81
Conversation
|
The logic for checking whether it crosses the line is fundamentally the same, so I don't think the behavior for numerical accuracy should be better/worse. It's mainly just a shortened version (with the observation that subtracting the booleans should result in the same sign as the cross product if it intersects). Other than that, the main change is that we're using a vector instead of iterators. |
|
Kattis PointInPolygon submission: https://ideone.com/T4D6qk Couldn't find |
simonlindholm
left a comment
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.
Looks good, seems like it should be equivalent to the previous version
The note about positive x direction depends on polygon orientation, anyway.

Built on top of #78 , so review/merge that one first. I'll rebase when that's merged.
This is currently mostly just for keeping track of what I'm working on.