2
* Force the vertices of a polygon to be in CW order.
4
* Works for polygons with concavities.
5
* Does not work for twisted polygons.
7
* ellson@lucent.com October 2nd, 1996
13
make_CW (Ppoly_t *poly)
22
/* points or lines don't have a rotation */
24
/* check CW or CCW by computing (twice the) area of poly */
25
for (i=1; i < n-1; i++) {
26
area += area2(P[0], P[i+1], P[i]);
28
/* if the area is -ve then the rotation needs to be reversed */
29
/* the starting point is left unchanged */
31
for (i = 1, j = n-1; i < 1+n/2; i++, j--) {