comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » sort points clockwise or clounterclockwise
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
sort points clockwise or clounterclockwise [message #91141] Mon, 08 June 2015 13:32 Go to previous message
junsix is currently offline  junsix
Messages: 3
Registered: June 2015
Junior Member
Hi,

I am trying to order points of closed polygon in clockwise or counterclockwise.
Here is a octagon and I tried to use Triangulate that I searched.

2 0
6 3
4 5
1 7

IDL> x=[3.,2.,2.,4.,1.,4.,1.,3.]
IDL> y=[4.,1.,4.,3.,2.,2.,3.,1.]
IDL> TRIANGULATE, X, Y, Triangles
IDL> help,triangles
TRIANGLES LONG = Array[3, 6]
IDL> print,triangles
4 1 7
4 7 6
6 7 2
2 7 5
2 5 3
2 3 0

The Triangulate returns each triangles in clockwise, while points in each triangles in counterclockwise.
But, what I need is to order points in clockwise or counterclockwise, e.g. 146203571 or 75302641, and then make polygon to calculate area and perimeter.
Thank you in advance.

Jun
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: buggy dictionary
Next Topic: Experience with ENVIRasterSeries?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:49:55 PDT 2025

Total time taken to generate the page: 0.00198 seconds