Find the vertex with smallest y (and largest x if there are ties). Let the vertex be A
and the previous vertex in the list be B
and the next vertex in the list be C
. Now compute the sign of the cross product of AB
and AC
.
References:
How do I find the orientation of a simple polygon? in Frequently Asked Questions: comp.graphics.algorithms.
Curve orientation at Wikipedia.