0

Suppose a particle has the following path

ParametricPlot[{2 (θ - π/2) + 2*Cos[θ], 
  2*(1 - Sin[θ])}, {θ, π/2, 4*π + π/2}]

which looks like this

enter image description here

I want to make an animation of the curve. In fact, if we consider the particle as a blue dot, inside the 2D plane. Then as $\theta$ evolves the blue dot which indicates the particle should follow the path according to the equations and thus leaving a solid line behind it. I tried this

Manipulate[
 ParametricPlot[{2 (θ - π/2) + 2*Cos[θ], 
   2*(1 - Sin[θ])}, {θ, π/2, θmax}], {θmax, π/2, 4*π + π/2}]

but it is not working! Why?

What is a simple way to do this?

Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
Hosein Rahnama
  • 1,727
  • 1
  • 15
  • 29

1 Answers1

1

A quick demo of Animate:

f[θ_] := {2 (θ - π/2) + 2*Cos[θ], 2*(1 - Sin[θ])}

Animate[
 ParametricPlot[f[θ], {θ, π/2, θmax}, 
  PlotRange -> {{0, 8 π}, {0, 4}}, PlotStyle -> Opacity[0.5],
  Epilog -> {Point[f[θmax]]}
  ],
 {θmax, π/2, 4*π + π/2}
 ]
Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
Quantum_Oli
  • 7,964
  • 2
  • 21
  • 43