# Animate a point moving on a polynomial

I'm new and want to animate a point that moves along the polynomial $s(t) = -2.7t^2 + 30t + 6.5$. I've seen examples for polar and parametric plots, but I haven't seen examples of polynomials.

• "I've seen examples" - where did you see them? They should not be too hard to modify for your particular case. – J. M. is in limbo Oct 24 '17 at 2:22
• you can use the ParametricPlot examples using {t, s[t]} as the first argument. – kglr Oct 24 '17 at 2:25
• Do you mean something like Animate[Show[Plot[s[t], {t, -20, 20}], Graphics[{PointSize[Medium], Point[{u, s[u]}]}]], {u, -20, 20}]? – aardvark2012 Oct 24 '17 at 2:40

It's not too hard to do. To run the animation, you need to open the animation controls by clicking on the plus button on the righthand end of the slider.

s[t_] := -2.7 t^2 + 30 t + 6.5


This is the point that will move along s[t].

pt[t_] := Graphics[{Red, AbsolutePointSize[8], Point[{t, s[t]}]}]


Want to limit the plot to values of s[t] that are positive.

tmax = Max @@ Solve[s[t] == 0, t][[All, 1, 2]]


11.3237

Here the Manipulate code that will allow for both manual and automatic movement (animation) of the point.

Manipulate[
Show[plot, pt[t]],
{{t, 0}, 0, tmax, .1, AppearanceElements -> All},
{{plot, Plot[s[t], {t, 0, tmax}, ImageSize -> 5 72]}, None}]


s[t_] := -2.7 t^2 + 30 t + 6.5;
Dynamic @ Plot[-2.7 t^2 + 30 t + 6.5, {t, 0, 15},
Mesh -> {{Clock[{0, 15}, 2, 2]}},
MeshStyle -> Directive[PointSize[Large], Red]]


Goes through the range 0 to 15 every 2 seconds and stops after 2 iterations.