Re: ListPolarPlot questions

• To: mathgroup at smc.vnet.net
• Subject: [mg124086] Re: ListPolarPlot questions
• From: "David Park" <djmpark at comcast.net>
• Date: Sun, 8 Jan 2012 04:26:36 -0500 (EST)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• References: <3193533.81836.1325933394495.JavaMail.root@m06>

Eric,

PeriodicInterpolation option. And use a higher InterpolationOrder.

datapoints = Table[phi = (i - 1) 2 Pi/10; Cos[phi]^2, {i, 1, 11}];

ListInterpolation[datapoints, {{0, 2 \[Pi]}},
InterpolationOrder -> 4, PeriodicInterpolation -> True]

Then use PolarPlot  with the radiusFunc. To translate to the circle use
Translate or GeometricTransformation with a Show statement but it is
confusing because of the necessary graphics level jumping. With the
Presentations Application from my web site it is easy. We just draw the
circle and translate the polar curve to the center of it.

<< Presentations`

Draw2D[
{Circle[{1, 1}, 1],
PolarDraw[radiusFunc[\[Theta]], {\[Theta], 0, 2 \[Pi]}] //
TranslateOp[{1, 1}]}]

David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/index.html

From: Eric Michielssen [mailto:emichiel at eecs.umich.edu]

Mathgroup:

I have two questions regarding the use of ListPolarPlot.

1. The function I'd like to plot is periodic.  Suppose I have samples of it
at equispaced angles, the first one for angle zero, and the last one for 2
Pi; the data for 0 and 2 Pi is identical.  I want to plot the function for
all angles, from 0 to 2 Pi, connected by a smooth line.  Choosing options
joined -> True and  InterpolationOrder -> 2 almost does the trick, except
that there is a kink in the graph at phi = 0.  As the interpolator does not
know the function is periodic.  Is there a way around that?

Example: g1 =  ListPolarPlot[Table[phi = (i - 1) 2 Pi/10; Cos[phi]^2, {i, 1,
11}],  DataRange -> {0., 2 Pi}, Axes -> None, Joined -> True,
InterpolationOrder -> 2]

(In practice my table is numerically derived, not that of a Cos^2 function)

2.  Suppose I want to plot a circle centered away from the origin, and then
the above g1 centered about the same point.  How do I do that?

Example:

g1 = Graphics[
ListPolarPlot[Table[phi = (i - 1) 2 Pi/10; Cos[phi]^2, {i, 1, 11}],
DataRange -> {0., 2 Pi}, Axes -> None, Joined -> True,
InterpolationOrder -> 2]];
g2 = Graphics[Circle[{1., 1.}, 1]];
Show[g1, g2]

But now with the center of g1 shifted to {1,1} (and, if possible, smooth
about phi = 0...).  I presume this can be done using Offset but I cannot get
that to work.

Thanks,
Eric Michielssen

• Prev by Date: Re: MatrixPower problem
• Next by Date: Re: ParametricPlot3D vs Reduce
• Previous by thread: Re: ListPolarPlot questions
• Next by thread: How to create a Dynamic monitoring palette that will keep working after a kernel restart?