Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Polygon from Unordered set of points
Date: Mon, 1 Jun 2009 11:34:02 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 15
Message-ID: <h00eba$l7o$1@fred.mathworks.com>
References: <gvvg1t$p64$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1243856042 21752 172.30.248.38 (1 Jun 2009 11:34:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 1 Jun 2009 11:34:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:543908


"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