Point in Polygon: Winding Number

how many times around did you wind? one and you're in; zero, you're not

The winding number is the number of complete turns an observer makes while traversing a polygon.  If the observer is outside the polygon, positive and negative angles will cancel, and the observer will make no turns; if the observer is inside the polygon, she will  make one complete turn.  The number of turns will be different for compound polygons (such as a polygon with a hole), or in other topologies; but for planar simple polygons, the winding number will be either zero or one.

The winding number requires the computation of an inverse trigonometric function, and it requires examining every pair of adjacent vertices.  Consequently, it is no better than the plumbline algorithm in complexity (that is, O(N), and may, in fact, be slower because the computation at each vertex is more difficult.

 

Movies

Four movies are available; the map shows Worcester County, Maryland (less resolution than other examples). One of the movies is a version with pauses for questions.  Remember the guidelines for use of these movies.

 


View and download: Worcester County, MD, with questions; (4.9 Mb)


View and download: Worcester County, MD, without questions; (4.7 Mb)


View and download: Worcester County, MD, with questions; (4.7 Mb)


View and download: Worcester County, MD, without questions; (4.8 Mb)

 

©2009 Franklin & Marshall College  |  Lancaster, PA  |  717-291-3911