# How to plot several animations from a parametric plot loop

I have a piece of code which plots parametric functions using for loops.

a = {6, 2}
b = {2, 6}
c = {-1, -2}
func = {}
For[i = 1, i <= 2, i++,
plot = ParametricPlot3D[{a [[i]] Cos[t] - c[[i]], b [[i]] Sin[t],
0}, {t, 0, 2 Pi}, PlotRange -> 7];
AppendTo[func, plot]]

Show[func]


This plots the following paths if i animate them using the following code:

a = {6, 1}
b = {2, 1}
c = {-1, -2}
func = {}
For[i = 1, i <= 2, i++,
plot = ParametricPlot3D[{a[[i]] Cos[t] - c[[i]], b[[i]]Sin[t],
0}, {t, 0, 2 Pi}, PlotRange -> 7];
AppendTo[func, plot]]

Animate[Show[func,
Graphics3D[{PointSize[Large], Red,
Point[Dynamic[{a [] Cos[t] - c[], b[] Sin[t], 0}]]}]
] , {t, 0, 10}]


I only get one point travelling around the elliptical path.

However,if i replace values of a,b,c with i, as per the loop

Animate[Show[func,
Graphics3D[{PointSize[Large], Red,
Point[Dynamic[{a [[i]] Cos[t] - c[[i]], b[[i]] Sin[t], 0}]]}]
] , {t, 0, 10}]


i get this plot and this error message: "Coordinate {-Part[{-1., -2.}, 3] - 0.9974703237996385 Part[{6., 1.}, 3], (-0.07108412719478453) Part[{2., 1.}, 3], 0.} should be a triple of numbers, or a Scaled form."

Is it possible to animate points travelling around their individual parametric paths within the same plot?

a = {6, 1}
b = {2, 1}
c = {-1, -2}
func = {}
For[i = 1, i <= 2, i++,
plot = ParametricPlot3D[{a[[i]] Cos[t] - c[[i]], b[[i]] Sin[t],
0}, {t, 0, 2 Pi}, PlotRange -> 7];
AppendTo[func, plot]]

Animate[Show[func,
Graphics3D[{PointSize[Large], Red,
Point[Table[{a[[i]] Cos[t] - c[[i]], b[[i]] Sin[t], 0}, {i, 1,
2}]]}]], {t, 0, 10}] Note :
- in your code, Dynamic is useless
- it is recommended not to use For[...]. Hence I use Table[...] in my mofiication of your code.

By the way, your code :

func = {}
For[i = 1, i <= 2, i++,
plot = ParametricPlot3D[{a[[i]] Cos[t] - c[[i]], b[[i]] Sin[t],
0}, {t, 0, 2 Pi}, PlotRange -> 7];
AppendTo[func, plot]]


could be rewritten like this :

func = Table[
ParametricPlot3D[{a[[i]] Cos[t] - c[[i]], b[[i]] Sin[t], 0}, {t, 0,
2 Pi}, PlotRange -> 7], {i, 1, 2}]

• Thanks for help, is there way to alter the framerate of the animation so that that it runs smoother? I have ~2000 objects that have been rotated by Euler rotation matrix and when I run the animation, its very slow – Luke4737 Mar 25 at 12:48