Group Abstract Group Abstract

Message Boards Message Boards

How do you put a dynamic in the limit of ParametricPlot without plln error?

GROUPS:
I can run the following code without issue:
DynamicModule[{\[Alpha] = {1, 0}}, {Show[
   Graphics[{{Dashed, Circle[], PointSize[0.1]},
     Locator[Dynamic[\[Alpha], (\[Alpha] = Normalize[#]) &]]},
    ImageSize -> Medium, PlotRange -> 1.2],
   ParametricPlot[{r*Cos[t], r*Sin[t]}, {r, 0,
     Sqrt[(1 - 0.25)/2]}, {t, 0, 2*\[Pi]}, PlotStyle -> {Red}]]}]

But when I introduce a dynamic to the upper limit of the radius r of the red disc using:
DynamicModule[{\[Alpha] = {1, 0}}, {Show[
   Graphics[{{Dashed, Circle[], PointSize[0.1]},
     Locator[Dynamic[\[Alpha], (\[Alpha] = Normalize[#]) &]]},
    ImageSize -> Medium, PlotRange -> 1.2],
   ParametricPlot[{r*Cos[t], r*Sin[t]}, {r, 0,
     Sqrt[(1 - Dynamic[\[Alpha][[1]]])/2]}, {t, 0, 2*\[Pi]},
    PlotStyle -> {Red}]]}]
I get the error:
ParametricPlot::plln: "Limiting value \!\(\*FractionBox[SqrtBox[RowBox[{\"1\", \"-\", DynamicBox[ToBoxes[Part[\$38748, 1], StandardForm],ImageSizeCache->{7., {0., 8.}}]}]], SqrtBox[\"2\"]]\) in \!\({r, 0, \*SqrtBox[FractionBox[RowBox[{\"1\", \"-\", DynamicBox[ToBoxes[Part[\$38748, 1], StandardForm],ImageSizeCache->{7., {0., 8.}}]}], \"2\"]]}\) is not a machine-sized real number. "


What is going on here? Can anyone help me sort out a dynamic as a limit in a Parametric Plot without plln error?

Any help much appreciated. Thanks.
POSTED BY: Mike Rigby
Answer
1 year ago
The warning message is

ParametricPlot::plln: Limiting value Sqrt[1-1]/Sqrt[2]  in  {r, 0, Sqrt[1-1]/Sqrt[2]} is not a machine-sized real number. 

The second 1 in 1-1 is wrapped in dynamic and formatting functions.
POSTED BY: Bruce Miller
Answer
1 year ago