MathGroup Archive 1998

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

Search the Archive

Re: RE: MaxBend in ParametricPlot?

Ted, you are very kind.

I think it's a deep misunderstanding on behalf of Matthias to expect a
carefully adapted algorithm for rendering on an anisotropic device to
isotropic results. I confess I was too lazy to write the function to
Matthias' problem.


-----Original Message-----
From: Ersek_Ted%PAX1A at To: mathgroup at
<Ersek_Ted%PAX1A at> Subject: [mg13026] [mg12961] RE: [mg12924]
MaxBend in ParametricPlot?

Matthias Weber  wrote:
|I am having trouble with the results I get by ParametricPlot. The
|documentation is sufficiently incomplete to prevent me from calling
|this a bug, but at least I would like to report the _behaviour_ I am
|unhappily confronted with:
|When I draw a round circle with ParametricPlot, I would expect to get
|the sample points more or less equidistributed, but the resulting
|distribution is rather strange. At the end is some code illustrating
|what I will explain now.
|The online doc says that Plot and ParametricPlot use an adaptive
|algorithm so that the kink angle between successive segments does not
|exceed MaxBend, which is '10' by default. (10 degrees, I suppose?).
The |minimal number of sample points is given by PlotPoints, which
initially |is 25.
|If I set MaxBend->1000 (degrees??), I get a list of 39 points. When
|setting PlotDivision->1 (which, as I understand it, should prevent any
|further subdivision), I get 40 points. All this lacks an explanation
to |me.
|The kink angle between consectutive segments on the drawn unit circle
|with initial settings varies (roughly) between 0.4 and 8.0 degrees,
|points with small kink angle accumulate near the points
|For the application I have in mind I want to extract the data computed
|by ParametricPlot and to use them, but I was hoping that
ParametricPlot |gives 'more adaptive' results. Is there a parameter
setting which gives |(near) equidistribution for a circle and is
nevertheless adaptive in |general? Is there |a desription of the
algorithm behind ParametricPlot available? Has |somebody written
his/her own version already? | |

_The Mathematica Graphics Guidebook_ by C. Smith & N. Blachman discusses
(in  great detail) the sampling algorithm Plot and ParametricPlot used
in Version  2.2.    I suspect the algorithm hasn't changed for version

This aspect of the sampling algorithm is discussed on pages 89-93 of the
above book.
In this discussion the authors explain that "bend angle" is computed by
normalizing the distances between adjacent samples so the three points
used  to form an angle fit into a box with length of one on each side.

They say if A is a vector from the middle sample to the left sample, and
B is a vector from the middle sample to the right sample. Then
Cos[BendAngle]=Dot[A,B]/(Magnitute[A] Magnitude[B])

This results in excessive sampling where the plot is vertical or
horizontal. However it also has an advantage in that you can zoom in on
a graphic  (without taking more samples) and the curve still looks

Here is an example:

cir=ParametricPlot[{Cos[t],Sin[t]},{t,0,2 Pi},AspectRatio->Automatic];

Show[cir, PlotRange->{{-0.03,0.03},{0.9993,1.}}, AspectRatio->1 /4,
ImageSize->{250,250}, Axes->None];

I don't know how to use the options to get the results you are looking

Ted Ersek

  • Prev by Date: Re: notebook
  • Next by Date: Re: Importing images
  • Previous by thread: RE: MaxBend in ParametricPlot?
  • Next by thread: Strange behavior of Sort