# How do you animate a parametric plot without specifying the range?

I'm trying animate a parametric plot without having to specify the range of the function variables, which will be done later on in a bigger animation. Here's my code:

x1[t_] := Sin[t]
y1[t_] := -Cos[t]
angle[t_] := Graphics[{Line[{{0, 0}, {x1[t], y1[t]}}]}];
tip[t_] := Graphics[{Disk[{x1[t], y1[t]}, 0.1]}]
frame = Graphics[{Line[{{-2, 2}, {-2, -2}, {2, -2}, {2, 2}, {2, 2}}]}];
path = ParametricPlot[{x1[t], y1[t]}, {t, 0, 10}];
Animate[
Show[path, frame, angle[t], tip[t]],
{t, 0, 10}, AnimationRunning -> False]


My problem is that I have to specify the range twice here and it's showing the full path of the ball instead of generating it dynamically.

Clear["Global*"]

x1[t_] := Sin[t]
y1[t_] := -Cos[t]
angle[t_] :=
Graphics[{Line[{{0, 0}, {x1[t], y1[t]}}]}];
tip[t_] := Graphics[{
ColorData["Rainbow"][t/(2 Pi)],
Disk[{x1[t], y1[t]}, 0.1]}]
frame := Graphics[{
Line[{{-2, 2}, {-2, -2}, {2, -2}, {2, 2}, {2, 2}}]}];
path[t_] := ParametricPlot[
{x1[a], y1[a]}, {a, 0, t},
ColorFunction ->
Function[{x, y, u}, ColorData["Rainbow"][u/(2 Pi)]],
ColorFunctionScaling -> False];
Animate[
Show[
path[t], frame, angle[t], tip[t],
PlotRange -> 1],
{t, 0.001, 2 Pi},
AnimationRunning -> False]


• Is there any way to make t start at 0? Dec 10, 2022 at 18:33
• Yes and no. It has to be done with mirrors. To change the Animate iterator to {t, 0, 2Pi} you would also have to change the ParametricPlot iterator to something like {a, 0, Max[t, 0.001]}` since any plot iterator must cover a nonzero interval. Dec 10, 2022 at 19:20