Mathematica Mathematica: moving point creating a curve

AI Thread Summary
The discussion revolves around creating an animated plot using Mathematica that combines a parametric plot of a sine and cosine wave with a moving point representing a circle. The original animation showcases the sine and cosine functions, but the user seeks to enhance it by adding a point that moves along the path of the plot. After some exploration, the user successfully integrates the moving point into the animation, adjusting parameters to ensure the point follows the curve while maintaining the overall visual appeal. The final code snippet demonstrates the successful implementation of both the animated plot and the moving point, achieving the desired effect.
MikhailKhot
Messages
2
Reaction score
0
Dear all,

here is my animation of a simple plot:

Animate[
ParametricPlot[ {Sin[tf], Cos[tf]}, {tf, 0, t}, PlotStyle -> {{Thickness[0.002], Red}, {Thickness[0.002], Blue}},
PlotRange -> {{-2, 2}, {-2, 2}, {-2, 2}}, AspectRatio -> Automatic], {t, 0.01, 100, 0.01},
AnimationRate -> 2, AnimationRunning -> False]

I want to have the same animation, but with a circle moving together with the plot, creating it, i.e. to combine the result above with

Animate[
Show[
Graphics[
{{PointSize[Large], Red, Point[{Sin[t], Cos[t]}]}}, PlotRange -> {{-2, 2}, {-2, 2}}, Axes -> True,
AspectRatio -> Automatic]], {t, 0, 100}, AnimationRate -> 1, AnimationRunning -> False]

How can I get it? Many-many thankd!
 
Physics news on Phys.org
Got an answer myself;))

Animate[
Show[
ParametricPlot[
{(1.2 + (1 - tf*0.1)*Boole[tf < 10])*
Sin[tf], (1 + (1 - tf*0.1)*Boole[tf < 10])*Cos[tf]},
{tf, 0, t},
PlotStyle -> {{Thickness[0.002], Red}, {Thickness[0.002], Blue}},
PlotRange -> {{-2.3, 2.3}, {-2.3, 2.3}, {-2.3, 2.3}},
Axes -> False, AspectRatio -> Automatic],
Graphics[{{PointSize[Large], Red,
Point[{(1.2 + (1 - t*0.1)*Boole[t < 10])*
Sin[t], (1 + (1 - t*0.1)*Boole[t < 10])*Cos[t]}]}},
PlotRange -> {{-2.3, 2.3}, {-2.3, 2.3}}, Axes -> False,
AspectRatio -> Automatic]],
{t, 0.01, 100, 0.01},
AnimationRate -> 2, AnimationRunning -> False]
 

Similar threads

Replies
4
Views
3K
Replies
1
Views
2K
Replies
2
Views
1K
Replies
2
Views
4K
Replies
8
Views
6K
Back
Top