3
$\begingroup$

I am attempting to animate my parametric plot and add a particle to move on the line but I am having difficulties. Here is my graph for the trajectory:

Manipulate[ParametricPlot3D[{v t, v γ Sin[θ t], v γ Cos[θ t]}, {t, 0, 20}], {v, 0, 
  2π}, {γ,0,2π}, {θ, 0, 2π}]

I want to have a circle that follows the path and here's my attempt at writing the animate code.

Animate[Show[
  [ParametricPlot3D[{v t, v γ Sin[θ t], v γ Cos[θ t]}, {t, 0, 20}], 
  Graphics[{Red, Disk[{v t, v γ Sin[θ t]}, 0.2]}]], {v, 
  0, 2π}, {γ, 0, 2π}, {θ, 0, 2π}]

I think that I messed up in the Graphics part but I am not sure how to add the parameters so that the particle can move along the line. Any suggestions? Could someone tell me what is going wrong?

$\endgroup$
1
  • $\begingroup$ "Disk" contains "t" that is defined in "ParametricPlot". Further, you can not simply combine 2D and 3D Graphics. $\endgroup$ Commented Feb 13, 2022 at 18:09

2 Answers 2

3
$\begingroup$
  • Method-1: Using MeshFunctions -> {#4 &}, MeshStyle -> {AbsolutePointSize[10], Red}, Mesh -> {{a}}, Method -> {"BoundaryOffset" -> False}]
Animate[ParametricPlot3D[{v t, v γ Sin[θ t], 
   v γ Cos[θ t]}, {t, 0, a}, MeshFunctions -> {#4 &}, 
  MeshStyle -> {AbsolutePointSize[10], Red}, Mesh -> {{a}}, 
  Method -> {"BoundaryOffset" -> False}], {a, $MachineEpsilon, 
  20}, {v, 0, 2 π}, {γ, 0, 2 π}, {θ, 0, 
  2 π}]
  • Method-2: Change the arrow style.
Animate[ParametricPlot3D[{v t, v γ Sin[θ t], 
    v γ Cos[θ t]}, {t, 0, a}] /. 
  Line[a_] -> {Arrowheads[{{.01, 
       1, {Graphics3D[{Red, Sphere[]}], 1}}}], 
    Arrow[a]}, {a, $MachineEpsilon, 20}, {v, 0, 2 π}, {γ, 
  0, 2 π}, {θ, 0, 2 π}]

enter image description here

$\endgroup$
2
$\begingroup$

I don't how to add particle to the path but, ı'm generally using arrows instead of trying to add particles.

Animate[ParametricPlot3D[{v t, v \[Gamma] Sin[\[Theta] t], 
v \[Gamma] Cos[\[Theta] t]}, {t, 0, a}] /. Line -> Arrow`, {a, 0, 20}, {v, 0, 2 \[Pi]}, {\[Gamma], 0, 2 \[Pi]}, {\[Theta], 0,` 2 \[Pi]}]` 
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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