Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mathematica: moving point creating a curve

Tags:
  1. Sep 23, 2014 #1
    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!
     
  2. jcsd
  3. Sep 23, 2014 #2
    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]
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Mathematica: moving point creating a curve
Loading...