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

Fix rounding errors #59

Merged
merged 2 commits into from
Jan 28, 2018
Merged

Fix rounding errors #59

merged 2 commits into from
Jan 28, 2018

Conversation

mfogel
Copy link
Contributor

@mfogel mfogel commented Jan 27, 2018

In working on #58, I noticed two of the test cases each have an extra point in their expected result to compensate for rounding errors. Instead of just a point at [-1783,-3], they each have two points: [-1783,-3] and [-1783,-2.999999999999999].

This PR fixes that issue.

In looking into that, I found out that the intersect function is being overzealous in applying the noEndpointTouch option - ie. returning null in cases when the intersection is not an endpoint of either line. That situation isn't being exercised by the test suite. This PR adds test cases for that and fixes that issue as well.

Again, thanks for you all for your work on martinez, very very helpful. Let me know if there's any tweaks you'd like to see to this PR. Cheers.

Was kicking in and returning null in cases when it shouldn't.
@w8r
Copy link
Owner

w8r commented Jan 28, 2018

That's very well spotted! Thank you @mfogel

@w8r w8r merged commit 4dd24ed into w8r:master Jan 28, 2018
@mfogel mfogel deleted the fix-rounding-errors branch January 29, 2018 12:59
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.

2 participants