By calculating the signed area value :
VolumeSet.VCoord(i) are the polygon nodes coordinates (or polyline nodes
coordinates ...). Beware of bowties ....
CCW means CounterClockWise ....
This is a long time ago written routine. Sorry, I do not have a compiler
anymore to provide a ready to use solution. If someone wants to compile
this and put it on the site's FTP (in case someone finds it useful enough
of course ....) with a little wrapper around ... feel free to do it ...
Eric.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Function CheckCCW (NNodes as integer) as logical
' Returns true if Polygon Vertex orientation is Counterclockwise
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function CheckCCW (NNodes as integer) as logical
Dim DoubleSignedBaseArea as float
Dim i as integer
DoubleSignedBaseArea = 0
For i = 1 to NNodes -1
DoubleSignedBaseArea = DoubleSignedBaseArea + ((VolumeSet.VCoord(i).X *
VolumeSet.VCoord(i+1).Y )- (VolumeSet.VCoord(i+1).X * VolumeSet.VCoord(i).Y
))
next
DoubleSignedBaseArea = DoubleSignedBaseArea +
((VolumeSet.VCoord(NNodes).X * VolumeSet.VCoord(1).Y )-
(VolumeSet.VCoord(1).X * VolumeSet.VCoord(NNodes).Y ))
If DoubleSignedBaseArea > 0 then
CheckCCW = TRUE
Else
CheckCCW = False
End IF
End Function
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: Anton de Gruchy [SMTP:[EMAIL PROTECTED]]
> Date: lundi 21 fevrier 2000 16:50
> A: MapInfo List (E-mail)
> Objet: MI Line Direction
>
> Hi all
>
> How do you determine the line direction of a polyline, clockwise or anti?
>
> Any help would really help.
>
> Anton de Gruchy
> -----------------
> MapIT - GIS Program development
> 35 Settlers Drive
> Edgemead, 7441
> Cape Town, South Africa
> Ph: 27 021 5580256
> Fax: 27 021 5590147
> Cell: 082 855 9747
> e-mail [EMAIL PROTECTED]
> URL: http://home.global.co.za/~jwdeg
> ----------------------------------------------------------------------
> 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]