Skip to content
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

fixed handling of collinear, included lines #2

Merged
merged 1 commit into from
Apr 3, 2016

Conversation

siebenschlaefer
Copy link
Contributor

doLineSegmentsIntersect did not correctly handle [Px, Qx, Qx, Px]
and [Qx, Px, Px, Qx] (for Px \elem (P, P2), Qx \elem (Q, Q2), (P, P2, Q,
Q2) collinear). The xor trick with "!=" does not work for an even number
of truthy values.

doLineSegmentsIntersect did not correctly handle [Px, Qx, Qx, Px]
and [Qx, Px, Px, Qx] (for Px \elem (P, P2), Qx \elem (Q, Q2), (P, P2, Q,
Q2) collinear). The xor trick with "!=" does not work for an even number
of truthy values.
@TheMarlboroMan
Copy link

Thanks @siebenschlaefer and @pgkelley4, adapted this solution for C++ and seems to be working allright :). This problem has been biting me all weekend!.

@pgkelley4
Copy link
Owner

Good catch @siebenschlaefer. Missed this.

@pgkelley4 pgkelley4 merged commit b6b2726 into pgkelley4:master Apr 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants