How to determine which side of the edge of the polygon is inside the polygon and outside?

I have a polygon edge (convex or concave). I want to know if, going straight from the beginning to the end of this edge, I have to turn right or left to get inside or outside the polygon. How can I check this?

+2
source share
2 answers

Move the entire polygon in this direction. If you find that you went clockwise, then the interior is on the right; if you went counterclockwise, then left.

+3
source

Another approach:

Project a perpendicular line and count how many times it crosses the other edges.

"--", - .

+1

Source: https://habr.com/ru/post/1682746/


All Articles