GeometricalPredicates.jl icon indicating copy to clipboard operation
GeometricalPredicates.jl copied to clipboard

Bug in `intriangle`

Open natschil opened this issue 5 years ago • 3 comments

The following code incorrectly returns 2, which according to the documentation means that the point is in the triangle:

using GeometricalPredicates

a = Point(1.1, 1.1)
b = Point(1.1,1.3)
c = Point2D(1.1, 1.4)

mytriangle = Primitive(a, b, c)
intriangle(mytriangle, Point(1.5, 1.8))

natschil avatar Sep 16 '20 19:09 natschil

I am referring to the part in the documentation where it says "1 + 1 = 2 means the test point is in front of a, exactly on the triangle". On the other hand, another part of the documentation says that 2 means that it "cannot tell", but as far as I can tell this is referring to incircle and not intriangle.

natschil avatar Sep 16 '20 19:09 natschil

@natschil As far as I can see, it is impossible to create a triangle from points you have mentioned above.

jstarczewski avatar Oct 23 '20 22:10 jstarczewski

Depending on your definition, any three points define a triangle.

natschil avatar Oct 25 '20 19:10 natschil