`corner_direction` wrongly returns `Orientation::None`
hannobraun opened this issue · 0 comments
hannobraun commented
I'm getting a wrong result from corner_direction
for a specific set of points. The following test fails, even though the points are clearly not on a line:
#[test]
fn corner_direction_bug() {
let p1 = Point::from([-0.5, 0.8660254037844387]);
let p2 = Point::from([1., 1.7320508075688772]);
let p3 = Point::from([-2., 0.]);
assert_ne!(corner_direction(&p1, &p2, &p3), Orientation::None);
}
I don't know what is special about these values. These just happened to be the points I've seen this issue with in my code base (modulo some light rounding). If I round the longer values (to 0.9
or 1.7
), the test no longer fails.