# Animating point

I'm new to mathematica and can't seem to make this animation work. Any help?

g = 9.81;
x[t_] := x0 + vel*Cos[th]*t;
y[t_] := y0 + vel*Sin[th]*t - (g*t^2)/2;
vel = 0; x0 = 5; y0 = 100; th = 0;
Animate[
Graphics[
{PointSize -> 0.05, Point[{x[t], y[t]}]}] , {t, 0, 10}]


the animation is starting without error but it's just a non-moving point.

(maybe has something to do with the version of mathematica I'm using? it's v7.0 trial version)

• PlotRange needs to be an option to Graphics inside Animate ( Your Graphics line does nothing at all, Graphics does not "remember" options from prior calls ) – george2079 Jun 19 '17 at 14:54
• Thanks, but that's not the issue. all it displays is a non-moving point in the midle of the screen. – LyrcAxis Jun 19 '17 at 14:59
• It does not move because by default Graphics auto ranges every frame to center the point. Thats why you need to specify a fixed plot range. – george2079 Jun 19 '17 at 15:04
• It can also be useful to draw a box to give yourself a reference frame, try this : Graphics[{{FaceForm[None], EdgeForm[Black], Rectangle[{0, 0}, {200, 200}]}, PointSize -> 0.05, Point[{x[t], y[t]}]}] – george2079 Jun 19 '17 at 15:16
• You're a genius, thanks! it seemed to work in another version so I tried this again here. (the general graphics options) case solved – LyrcAxis Jun 19 '17 at 15:17

g = 9.81;
x[t_] := x0 + vel*Cos[th]*t;
y[t_] := y0 + vel*Sin[th]*t - (g*t^2)/2;
vel = 0;
x0 = 5;
y0 = 100;
th = 0;

{xmin, xmax} = #[{x[t], 0 <= t <= 10}, t] & /@
{MinValue, MaxValue}

(*  {5, 5}  *)

{ymin, ymax} = #[{y[t], 0 <= t <= 10}, t] & /@
{MinValue, MaxValue}

(*  {-390.5, 100.}  *)

Animate[
Graphics[{
PointSize -> 0.05,
Point[{x[t], y[t]}]},
PlotRange -> {
{Floor[xmin - 5, 10], Ceiling[xmax + 5, 10]},
{Floor[ymin - 5, 10], Ceiling[ymax + 5, 10]}},
Frame -> True,
AspectRatio -> 1], {t, 0, 10}]