# Why does my equation for ballistic trajectory not work?

Recently I have been working on the problem of calculating a ballistic trajectory. I landed on the following equation: $$y = tan(θ)x - gt^2$$, where $$θ$$ is the launch angle, $$x$$ is the distance travelled horizontally, g is 9.81, t is time and y is the height relative to the starting position after having travelled x distance horizontally. However, the problem I am having is that as θ increases so does y after x distance travelled, which does not correctly model real-world behaviour. There should be a point at which launching the object at a higher angle decreases the height after x distance travelled. I have previously seen equations involving other trig functions when calculating a ballistic trajectory, but I wanted a good explanation as to why this is needed.

• If you are given $x$ and wish to find the point $(x,y)$ on the trajectory, how do you get the value of $t$, which you also need in order to apply your formula?
– David K
Aug 26, 2022 at 23:37
• x/v where v is velocity Aug 26, 2022 at 23:38
• Ok thanks I will put it up there Aug 26, 2022 at 23:39
• Your error is that $t \neq x/v$ because the projectile is not just moving along the $x$ axis.
– David K
Aug 26, 2022 at 23:40
• I guess your equation came from $y = vt \sin\theta - \frac 12 gt^2$, with $vt = x/\cos\theta$. If you actually substitute the remaining $t$ (in the $-\frac 12 gt^2$) too, you might get something that better link $x$ and $y$.
– peterwhy
Aug 26, 2022 at 23:44

With the given acceleration and initial speed and position: $$\ddot r(t)=(0,-g)\\ \dot r_0=(v_0\cos(\theta),v_0\sin(\theta))\\ r_0=(0,0)$$ the integration gives: $$\dot r(t)=(v_0\cos(\theta),v_0\sin(\theta)-gt) \\ r(t)=(v_0\cos(\theta)t,v_0\sin(\theta)t-\frac12 gt^2)$$ so the horizontal and vertical position are: $$x(t)=v_0\cos(\theta)t\\ y(t)=v_0\sin(\theta)t-\frac12 gt^2$$
And the last expression can be written as: $$y(t)=\tan(\theta)x(t)-\frac12 gt^2$$ or better, replacing the $$t$$: $$y=\tan(\theta)x- \frac{g}{2v_0^2\cos(\theta)^2}x^2$$