Hello,

If you're referring to my post, in wich one could find a polygon oriented 
algorithm, here's the answer :
A polyline can be handled just like an unclosed polygon. Take a look at the 
implementation, you'll see it's not a problem. The algorithm computes the 
signed area of the polygon constitued by the polylines segments, and adds 
the last, closing one ... Depending on the general shape of your polylines, 
it might be wiser (and enough) to study the rotation of 3 consecutive nodes 
(2 segments and a virtual closing one). That would define a triangle, made 
of the 3 first nodes of your polyline, and should be enough to check CCW.

For information, the mathematical background of this is about direct or 
inverse orientation of consecutive node in a given axis system (remember 
the corkscrew turning right or left or fiddling with your fingers (3 
fingers painted with x,y,z) in your math class?). This kind of check is 
needed if you display a triangle (polygon) in a display viewport, for it 
defines where the surface normal is pointing to, and thus on wich side of 
the triangle it has to be drawn (in the computer world, a triangle has two 
faces, and only one has to be drawn: the one facing the user). Please refer 
to your favorite geometry and trigonometry class book for more accurate 
details :), and avoid twisting your elbow too much ...



Eric Maranne
EMI Informatiques
web : www.cycweb.com/equipage
~~~~~~~~~~~~~~~~~~~~
(33) +4 42 06 22 22    GMT +1
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~
GIS - VRML Integration

> -----Message d'origine-----
> De:   MAPPER MAN [SMTP:[EMAIL PROTECTED]]
> Date: jeudi 24 fevrier 2000 22:24
> A:    [EMAIL PROTECTED]
> Objet:        MI re: Line Direction
>
> who was the owner of the question ? i found a algorithm for this question 
> but it is working for poligon..
>
> i wanna ask what is the meaning of a polyline object clockwise direction 
?
> it can have a general south north east  northeast ... direction but to 
have
> a clockwise or counterclockwise direction it must be a closed polyline 
???
>
> Maper Man
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
> ----------------------------------------------------------------------
> To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
> "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to