How to determine which side of a polygon edge is inside a polygon, and which is outside?
I have an edge of a polygon (convex or concave). I want to find out if, going straight from start to end point of that edge, I have to turn right or left to get inside or outside of polygon. How can I check that? Traverse the whole polygon in that direction. If you find that you went clockwise, then the interior is to the right; if you went counter-clockwise, it's to the left. Another approach: Project a perpendicular line and count how many times it crosses other edges. odd -> interior zero or even -> exterior Equivalently If you happen to have a well optimized point-in-polygon routine