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

Visibility graph bug #51

Open
yaara-shoval opened this issue Apr 16, 2020 · 1 comment
Open

Visibility graph bug #51

yaara-shoval opened this issue Apr 16, 2020 · 1 comment

Comments

@yaara-shoval
Copy link

I tried to build a visibility graph with the following input:
[[vg.Point(x=119.55624999999999, y=16.48333333333367), vg.Point(x=203.7872976182326, y=81.64246915103985), vg.Point(x=203.78733213720346, y=112.326984303335), vg.Point(x=189.70101758191677, y=112.326984303335), vg.Point(x=184.99113388465582, y=75.10000000000025), vg.Point(x=184.99113388465582, y=103.01666666666668), vg.Point(x=133.69454408285583, y=103.01666666666668), vg.Point(x=133.69454408285583, y=75.10000000000025), vg.Point(x=131.22787741618916, y=75.10000000000025), vg.Point(x=131.22787741618916, y=103.0166666666666), vg.Point(x=119.55624999999999, y=103.01666666666759)]].

This was the result:
image

I solved this by rounding the points before giving them as input.
I suggest fixing this bug.

@TaipanRex
Copy link
Owner

This isnt really a bug, its a consequence of small differences in floating points. See this, "floating point representation errors".

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

No branches or pull requests

2 participants