Question

This polygon could be shaped like a C

I tried the formula located here How can I determine whether a 2D Point is within a Polygon?

however it doesn't actually correctly predict if the point is in the polygon.

Was it helpful?

Solution

Easiest way - especially for lots of points is to triangulate the polygon then do a point in triangle test.
You could convert the polygon into a set of convex polygons but that is trickier.

See also Random points inside a 4-sided Polygon

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top