Saturday, November 14, 2015

Simple point in polygon test

I've seen a few ways to test for whether a point is in a convex polygon or not that necessitated using inverse trig functions, but this one is all easily calculated the distance functions can be left without taking the square root and just comparing distance-squared instead...
R and L are exactly the points you get when you rotate he line AB 90 degrees around it's midpoint... I think the nice thing is how the reasoning might extend to 3d convex polytopes with L and R making a line orthogonal to each face...

No comments:

Post a Comment