Thread Subject: Polygon from Unordered set of points

Subject: Polygon from Unordered set of points

From: Balwinder Singh

Date: 1 Jun, 2009 02:57:01

Message: 1 of 4

Hi All,
I have an unordered set of points (x,y). I want to form a polygon from these vertices which should arrange the points in either clockwise or anticlockwise sense. Is it possible to do in MATLAB?

Thanks.

Subject: Polygon from Unordered set of points

From: Bruno Luong

Date: 1 Jun, 2009 11:34:02

Message: 2 of 4

"Balwinder Singh" <balwindersingh@gmail.com> wrote in message <gvvg1t$p64$1@fred.mathworks.com>...
> Hi All,
> I have an unordered set of points (x,y). I want to form a polygon from these vertices which should arrange the points in either clockwise or anticlockwise sense. Is it possible to do in MATLAB?
>

Posed generally like that, the answer is no, because there is many way to connect the points to form a polygon. You need to specify something else. For example:

- Whereas your polygon is convex
- If you look for a polygone that minimizes the circumference.

The first problem is easy, the second problem is called "Travelling Saleman problem", and it is one hardest problem in algorithmic http://en.wikipedia.org/wiki/Travelling_salesman_problem

Now the question is where you place your problem in between?

Bruno

Subject: Polygon from Unordered set of points

From: ImageAnalyst

Date: 1 Jun, 2009 11:53:14

Message: 3 of 4

On May 31, 10:57 pm, "Balwinder Singh" <balwindersi...@gmail.com>
wrote:
> Hi All,
> I have an unordered set of points (x,y). I want to form a polygon from these vertices which should arrange the points in either clockwise or anticlockwise sense. Is it possible to do in MATLAB?
>
> Thanks.

--------------------------
Can't you just find the centroid, then find the angle from the
centroid to each of the points, then sort based on angle? You'd get a
multi-pointed star-like object I would think.

Subject: Polygon from Unordered set of points

From: Luigi Giaccari

Date: 1 Jun, 2009 16:50:19

Message: 4 of 4

"Balwinder Singh" <balwindersingh@gmail.com> wrote in message <gvvg1t$p64$1@fred.mathworks.com>...
> Hi All,
> I have an unordered set of points (x,y). I want to form a polygon from these vertices which should arrange the points in either clockwise or anticlockwise sense. Is it possible to do in MATLAB?
>
> Thanks.

The solution to this problem heavly depends on the shape of your dataset.
ONe solution may be the traveling salesman. For convex shape is the convex hull.

I thing in the general case you have to find delaunay edges.

For more see:


   doc
         demos
                  Mathematics
                                     Creating and editing delaunay triangulation
                                          Example 7(Example Seven: Curve Reconstruction from a Point Cloud)




http://giaccariluigi.altervista.org/blog/


                                           

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
polygon pipa 31 May, 2009 22:59:03
unordered set o... pipa 31 May, 2009 22:59:03
rssFeed for this Thread

Contact us at files@mathworks.com