1
$\begingroup$

In the following code:

p1=ParametricPlot3D[{ (3 + Cos[v]) Sin[u], (3 + Cos[v]) Cos[u], Sin[v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi}]

p2=ParametricPlot3D[{Cos[Sqrt[2] t](3 + Cos[t]), Sin[Sqrt[2] t] (3 + Cos[t]), Sin[t]}, {t, 0, 50}]

p3=ParametricPlot3D[{Cos[Sqrt[2] t](2 + Cos[t]), Sin[Sqrt[2] t] (2 + Cos[t]), 8+Sin[t]}, {t, 0, 50}] /. Line -> ({CapForm[None], FaceForm[Green, White], Tube[#, .25]} &)

Show[p1,p2,p3]

enter image description here

  1. How can I animate p2 and p3 to generate simultaneously?
  2. How can I download the resulting animated graph as a video?
  3. How can I remove the coordinates?

Thanks!

$\endgroup$
  • 1
    $\begingroup$ For the last part, use Axes ->False. $\endgroup$ – kglr Jun 16 at 7:17
2
$\begingroup$
p1 = ParametricPlot3D[{(3 + Cos[v]) Sin[u], (3 + Cos[v]) Cos[u], 
    Sin[v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi}, 
   PlotStyle -> Opacity[.5], Mesh -> None];

ClearAll[p2, p3]
p2[tmax_] := ParametricPlot3D[{Cos[Sqrt[2] t] (3 + Cos[t]), 
    Sin[Sqrt[2] t] (3 + Cos[t]), Sin[t]}, {t, 0, tmax}, PlotStyle -> Thick];
p3[tmax_] := ParametricPlot3D[{Cos[Sqrt[2] t] (2 + Cos[t]), 
     Sin[Sqrt[2] t] (2 + Cos[t]), 8 + Sin[t]}, {t, 0, tmax}] /. 
   Line -> ({CapForm[None], FaceForm[Green, White], Tube[#, .25]} &);

Manipulate[Show[p1, p2[tmax], p3[tmax], PlotRange -> All, Axes -> False], {tmax, 1, 50}]

enter image description here

To export as a GIF animation:

frames = Table[Show[p1, p2[tmax], p3[tmax], PlotRange -> All], {tmax, 1, 50}];
Export["frames.gif", frames]

enter image description here

$\endgroup$
  • $\begingroup$ Can you please attach the animation here? I am using an online version of mathematica and it is not very good. Thanks always! $\endgroup$ – user21210 Jun 16 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.