Polygons and Winding Numbers
MOSIS Technical Notes

A polygon encloses an area of the plane, thus dividing the plane into that area which is "inside" the polygon and that which is "outside." For a simple polygon, the two regions are the obvious ones. However, when a polygon's boundary intersects itself, then the definition of inside and outside is not so simple.
A winding number is an attribute of a point with respect to a polygon that tells us how many times the polygon encloses (or wraps around) the point. It is an integer, greater than or equal to 0. Regions of winding number 0 (unenclosed) are obviously outside the polygon, and regions of winding number 1 (simply enclosed) are obviously inside the polygon. For a simple polygon, these are the only possible winding numbers. However, a self-intersecting polygon can create regions with winding number 2 (or greater), and these regions present a definitional problem.

