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 [[1]] Cos[t] - c[[1]], b[[1]] Sin[t], 0}]]}]
] , {t, 0, 10}]
I only get one point travelling around the elliptical path.
However,if i replace values of a[1],b[1],c[1] 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?