Mathematica Asked by user21210 on January 19, 2021
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]
Thanks!
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}]
To export as a GIF animation:
frames = Table[Show[p1, p2[tmax], p3[tmax], PlotRange -> All], {tmax, 1, 50}];
Export["frames.gif", frames]
Correct answer by kglr on January 19, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP