Re: Using Nearest on a group of points
- To: mathgroup at smc.vnet.net
- Subject: [mg117598] Re: Using Nearest on a group of points
- From: Peter Pein <petsie at dordos.net>
- Date: Thu, 24 Mar 2011 06:28:01 -0500 (EST)
- References: <im9sk8$g5j$1@smc.vnet.net>
Am 22.03.2011 11:11, schrieb Martin VavpotiÄ?: > Hello. I need some help with the function Nearest. > > I have a groups of points, each with two coordinates (x,y), describing > a connected shape (the last point is a neighbor to the first one). The > initial order of these points is completely scrambled but I need them > to follow one another so their sequence describes a combined shape. I > thought of using the Nearest function but there is a problem. > Somewhere in the middle of my shape is a large gap where no points > reside. I fear that if I use Nearest, the function will find the wrong > point. > > What I need is for function Nearest to ignore points already sorted > and search only for points that have not been used yet. > b.t.w.: Nearest[pts,{0.0},Length[pts]] seems to produce an usable result too :-) Peter