In two-dimensional computer graphics, the non-zero winding rule is a means of determining whether a given point falls within an enclosed curve.
Unlike the similar even-odd rule, it relies on knowing the direction of stroke for each part of the curve.
The winding number is effectively a count of how many full counter-clockwise revolutions ('windings') the curve makes around P without doubling back on itself.
One formal definition of the winding number of point P with respect to curve C (where P does not lie on the curve) is as follows: Consider a point Q that travels once around C. The endpoint of a vector from P to Q, after normalization, travels along the unit circle centered at P. If we imagine the track of this endpoint as a rubber band, and let the band contract, it will end up wrapped about the circle some number of times.
[1]The SVG computer graphics vector standard uses the non-zero rule by default when drawing polygons.