Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!munnari.oz.au!metro!usage.csd.unsw.oz.au!usage.csd!lambert From: lambert@spectrum.cs.unsw.oz.au (Tim Lambert) Newsgroups: comp.graphics Subject: Re: Need to find polygon direction (cw/ccw) Message-ID: Date: 10 Dec 90 13:03:43 GMT References: <548@ub.d.umn.edu> Sender: news@usage.csd.unsw.oz.au Followup-To: comp.graphics Organization: EE & CS, Uni of NSW, Australia Lines: 13 In-reply-to: jtevik@gisplot1.nrri.umn.edu's message of 9 Dec 90 19:40:14 GMT >>>>> On 9 Dec 90 19:40:14 GMT, jtevik@gisplot1.nrri.umn.edu (John Tevik) said: > Here's one for the FAQ. I need to find the direction (whether clockwise or > counter-clockwise) of a 2D polygon. Calculate the *signed* area: A = 0.5*\sum_{i=1,2..n} x_i * (y_{i+1} - y_{i-1}) This is positive if and only if the polygon is anti-clockwise. (This is faster than calculations involving angles.) Tim