Path: utzoo!utgpu!watserv1!watmath!att!att!dptg!ulysses!andante!alice!td From: td@alice.att.com (Tom Duff) Newsgroups: comp.graphics Subject: Re: clockwise or counter-clockwise 2d polygons Summary: oops, small typo Message-ID: <11525@alice.att.com> Date: 23 Oct 90 13:46:15 GMT References: <1990Oct22.114039.8799@jarvis.csri.toronto.edu> Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 11 My last posting contained a small error. Perhaps this one does too. The correct text of the orientation-testing routine is (I think): Isclockwise(float *pv, int nv){ float *p1, *p2, *endp=pv+2*nv; float area=0; /* acually twice the area */ for(p1=pv, p2=endp-1; p1!=endp; p2=p1, p1+=2) area+=(p2[0]-p1[0])*(p2[1]+p1[1]); return area<0 ? 1 : area>0 ? 0 : -1; }