MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: FindCurvePath has a problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127440] Re: FindCurvePath has a problem
  • From: Dana DeLouis <dana01 at me.com>
  • Date: Wed, 25 Jul 2012 02:32:15 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

Hi.  Don't have a suggestion, but an observation.
It appears one can get a solution by either dropping the first item, or the last 2 items.

v = {Your Data Here}

Length[v]
84

Here, I can get a solution by only dropping the last 2 items.
Complement is used to display those points that were not in the solution (of the first 82)

p=FindCurvePath[v[[;;82]]];

Complement[Range@82,Flatten[p]]
{13,18,23,24,49,51,52,53,54,58,59,74,75,79,80}

Here, only the first point is dropped.

p=FindCurvePath[v[[2;;]]];

Complement[Range@83,Flatten[p]]+1
{13,18,23,24,49,51,52,53,54,58,59,74,75,79,80,81,82}

Note:  +1 added above to get it's position in the original list.
There appears to be common points that the function wants to drop.

Interesting Function.   Here's a half circle, with a point added that is slightly on the way back to the origin.

m=Table[{Cos[t],Sin[t]},{t,0,2Pi,Pi/16}]  [[;;17]];
AppendTo[m,{-0.99,-0.01}];

FindCurvePath[m]
{{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18}}

The path is from 1 to 18.

Here's the same half circle, with the last point increased to -.02.

m=Table[{Cos[t],Sin[t]},{t,0,2Pi,Pi/16}]  [[;;17]];
AppendTo[m,{-0.99,-0.02}];

Now, we get a curve path back to the starting point.
Wonder why it starts at point 2, and not just point 1 ??

FindCurvePath[m]
{{2,1,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2}}


ListLinePlot[m,AspectRatio->Automatic]

= = = = = = = = = =
Dana DeLouis
Mac & Math 8
= = = = = = = = = =




On Jul 20, 3:52 am, Ralph Dratman <ralph.drat... at gmail.com> wrote:
> The following input to FindCurvePath produces the output shown below it:
> 
> FindCurvePath[{{278,141},{279,141},{279,142},{279,143},{280,143},{280,144},
> {280,145},{280,146},{281,147},{281,148},{281,149},{281,150},{282,150},{282,
> 151},{282,152},{283,151},{283,152},{283,153},{284,153},{284,154},{285,155},
> {286,155},{286,156},{287,156},{287,157},{288,157},{289,156},{290,156},{290,
> 157},{291,156},{291,157},{292,156},{292,157},{293,156},{293,157},{294,156},
> {294,157},{295,156},{295,157},{296,156},{296,157},{297,156},{297,157},{298,
> 155},{298,156},{299,155},{299,156},{300,155},{301,154},{301,155},{302,153},
> {302,154},{303,152},{303,153},{304,150},{304,151},{304,152},{305,149},{305,
> 150},{306,146},{306,147},(*{306,148},{306,149},{307,144},{307,145},{307,146},{308,141},{308,142},{308,143},{308,144},{309,139},{309,140},{309,141},{31
> 
> 0,138},{310,139},{311,136},{311,137},{311,138},{312,135},{312,136},{313,134},{313,135},*){314,133},{314,134}}]
> 
> FindCurvePath::ntri:    The data generates an inconsistent
> triangulation. You can perturb the data to make it valid. >>
> Fail
> 
> If you restore the commented-out list elements (beginning with
> (*{306,148}...), then evaluate, you get an apparently never-ending
> silent hangup, which is of course far worse than an error message.
> 
> I have not yet tried to "perturb" anything to work around the problem.
> Clearly the function needs to check its arguments before wandering off
> into lala land.
> 
> Ralph Dratman







  • Prev by Date: Excel Headers --> Mathematica
  • Next by Date: Re: Can anyone see a faster way to compute quantities for a pair or
  • Previous by thread: Re: FindCurvePath has a problem
  • Next by thread: Solving Third Order differential equation using Mathematica.