2

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.

Community
  • 1
  • 1
Mel
  • 2,055
  • 2
  • 26
  • 45

1 Answers1

2

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

Community
  • 1
  • 1
Martin Beckett
  • 94,801
  • 28
  • 188
  • 263