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

orientation fails to identify points exactly on the line in some cases #12

Closed
toddwagn opened this issue Apr 4, 2016 · 1 comment
Closed

Comments

@toddwagn
Copy link

toddwagn commented Apr 4, 2016

julia> orientation(Line(Point(1.,1.), Point(1.8, 1.6)), Point(1.4, 1.3))
1

julia> orientation(Line(Point(1.,1.), Point(1.8, 1.6)), Point(1.4, prevfloat(1.3)))
-1

@skariel
Copy link
Contributor

skariel commented Apr 11, 2016

Hi!

Sorry for my late reply I saw this issue just now.

So the result is right, there is no problem at all here (you have to be VERY careful when dealing with numerics). Indeed Point(1.4,1.3) is to the left of the line and Point(1.4, prevfloat(1.3)) is to the right. The numerical line is not "continuous" in any way

In fact it is very hard to find points exactly on this line, see code and plot below:

screenshot from 2016-04-11 12 16 05

@skariel skariel closed this as completed Apr 11, 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

No branches or pull requests

2 participants