MathGroup Archive 1999

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

Search the Archive

Re: ParametricPlot with jumps

  • To: mathgroup at smc.vnet.net
  • Subject: [mg16281] Re: [mg16123] ParametricPlot with jumps
  • From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
  • Date: Sun, 7 Mar 1999 01:05:24 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

On Sat, Feb 27, 1999, David Epstein <dbae at maths.warwick.ac.uk> wrote:

>I want to do something similar to the following. I have a curve on a
>cylinder. I want to cut the cylinder
>along one of its generators and open it out to a flat strip (the inverse
>process to how cans are made).
>
>If I now use ParametricPlot to see what the curves look like on the flat
>strip, there are jumps where the
>curves cross the generator which has turned into a pair of edges of the
>flat strip. The way
>ParametricPlot treats this situation is to construct an artificial
>interpolation between the two points
>where the curve meets corresponding opposite edges of the strip. What I
>want it to do is not to make
>this interpolation.
>
>One way to achieve this is to solve for when the curve cuts the edge of
>the figure and then do separate plots between each of these intersection
>points. Is this the easiest way, or is there some way of telling
>ParametricPlot not to interpolate over huge distances?
>
>David Epstein
>

It seems to me that the easiest way to solve your problem is not to use
ParametricPlot at all, but instead make a table of values and use
ListPlot. For example, (if I understand you correctly) the type of
problem you are referring to is illustrated by this example:

In[10]:=
ParametricPlot[{Mod[t,1],t^2},{t,0,3}]

You can get an equally good picture without the interpolation by using

In[11]:=
ListPlot[Table[{Mod[t,1],t^2},{t,0,3,0.001}],PlotStyle->{PointSize[0.001]}]

The only drawback seems to be that it takes rather longer to get a
picture of comparable smoothness.

Having said that, one can also do what you want by making use of
ParametricPlot and getting rid of th einterpolationg lines, but this is
more complicated an I am not sure worth th etrouble. However, let me
illustrate what I mean on the above example. Let

badgraph= ParametricPlot[{Mod[t,1],t^2},{t,0,3}];

then

coords=badgraph[[1,1,1,1]];

is just the list of pairs of coordinates of points in badgraph. We  now 
split this list  into sublists with the property that the first
coordinates of successive pairs within each list  differ by less than a
fixed number, e.g. 0.5, then map Line onto each sublist  and create the
corresponding graphic object:

goodgraph=Graphics[Map[Line,Split[coords,(Abs[#1[[1]]-#2[[1]]]<0.5&)]]];

Show[goodgraph]

It looks just like the one created using ListPlot bu tis much faster to
render.

I hope I have not misunderstand you and all this is of some help!


Andrzej Kozlowski
Toyama International University
JAPAN
http://sigma.tuins.ac.jp/
http://eri2.tuins.ac.jp/

Andrzej Kozlowski
Toyama International University
JAPAN
http://sigma.tuins.ac.jp/
http://eri2.tuins.ac.jp/



  • Prev by Date: Re: Re: integration problem
  • Next by Date: Re: Multiply a constant to a matrix column
  • Previous by thread: Re: ParametricPlot with jumps
  • Next by thread: Fourier transform