# High School Physics/Projectile motion

The case of uniform gravity , disregarding drag and wind, yields a projectile motion trajectory which is a parabola. To model this, one chooses $V=mgz$, where $g$ (gee) is the so-called acceleration of gravity.
Relative to a flat terrain, let the initial horizontal speed be $v_{h}$, and the initial vertical speed be $v_{v}$. It will be shown that, the range is $2v_{h}v_{v}/g$, and the maximum altitude is ${v_{v}^{2}}/2g$. The maximum range, for a given total initial speed $v$, is obtained when $v_{h}=v_{v}$, i.e. the initial angle is 45 degrees. This range is $v^{2}/g$, and the maximum altitude at the maximum range is a quarter of that.

## Derivation

The equations of motion may be used to calculate the characteristics of the trajectory.
Let:
    $t\;$ be the time into the flight of the projectile
    $d_{h}(t)\;$ be the horizontal displacement at time t
    $d_{v}(t)=z\;$ be the vertical displacement at time t
    $v_{h}\;$ be the horizontal velocity (which is constant)
    $v_{v}\;$ be the initial vertical velocity upwards
    $v\;$ be the initial speed
    $v_{v}(t)\;$ be the vertical velocity at time t
Along the horizontal dimension, $v_{h}$ is a constant and thus by the equations of motion,
    $d_{h}(t)=v_{h}t\;$ (Equation 1)
The vertical distance, or altitude, follows the equations of motion for constant negative acceleration $g$:
    $d_{v}=v_{v}t-{{gt^{2}} \over 2}$ (Equation 2)
    $v_{v}={\frac {d}{dt}}d_{v}(t)=v_{v}-gt$ (Equation 3: velocity equation which is the derivative of equation 2)
The range of the projectile occurs when $d_{v}(t)$ is zero again and intercepts the ground. This occurs when $d_{v}$ in equation 2 is zero:
    $0=v_{v}t-{{gt^{2}} \over 2}$
Solving this for time $t$ gives the time of the projectile's flight:
    $t={2v_{v} \over g}$ (Equation 4: "hang time" of projectile)
The maximum range occurs when equation 4 is substituted into equation 1:
    $d_{h}(t)={v_{h}t}={v_{h}({2v_{v} \over g})}={{2v_{h}v_{v}} \over g}$ (Equation 5: range of projectile)
The maximum altitude for a given trajectory occurs when the vertical velocity is zero. Thus set equation 3 to zero:
    $0=v_{v}-gt\;$
Solving for $t$
    $t={{v_{v}} \over g}$
This can be substituted into equation 2 to give the maximum altitude:
    $d_{v}(max)=v_{v}({v_{v} \over g})-{\frac {1}{2}}g({v_{v} \over g})^{2}={{v_{v}}^{2} \over 2g}$ (Equation 6: maximum altitude of projectile)
Thus, not surprisingly, for a given initial speed the attained altitude is highest if the initial velocity was straight up. This altitude is twice the attained altitude when the range is maximized.

## Derivation in polar coordinates

In terms of angle of elevation $\theta$ and initial speed $v$:
    $v={\sqrt {{v_{h}}^{2}+{v_{v}}^{2}}}$
    $v_{h}=v\cos \theta \;$
    $v_{v}=v\sin \theta \;$
Substituting into Equation 1 gives:
    $d_{h}=v_{h}t=vt\cos \theta \;$ (Equation 1a)
Substituting into Equation 2 gives:
    $d_{v}=v_{v}t-{{gt^{2}} \over 2}=(v\sin \theta )t-{{gt^{2}} \over 2}$ (Equation 2a)
Taking the derivative gives the vertical velocity:
    $v_{v}={\frac {d}{dt}}d_{v}={\frac {d}{dt}}(v\sin \theta )t-{{gt^{2}} \over 2}=v\sin \theta -gt$ (Equation 3a: vertical velocity)
Hang time calculated above in equation 4 may be expressed in terms of angle of elevation:
    $t={2v_{v} \over g}={{2v\sin \theta } \over g}$ (Equation 4a)
Equation 4a may be substituted into Equation 1a to get the horizontal distance or range:
    $d_{h}=v_{h}t={vt\cos \theta }=v({{2v\sin \theta } \over g})\cos \theta ={{2v^{2}\sin \theta \cos \theta } \over g}$
Now using the trigonometric identity for $2\sin \theta \cos \theta =sin2\theta$:
    $d_{h}={{v^{2}\sin 2\theta } \over g}$ (Equation 5a: range of projectile)
This may be solved for angle $\theta$ to give the "angle" equation to hit a target at range $d_{h}$:
    ${\theta }={\frac {1}{2}}\sin ^{-1}({{gd_{h}} \over {v^{2}}})$ (Equation 7: angle of projectile launch)
Note that the sine function is such that there are two solutions for $\theta$ for a given range $d_{h}$. Physically, this corresponds to a direct shot versus a mortar shot up and over obstacles to the target.
The maximum altitude for a given range may be determined by setting the vertical velocity to zero in equation 3a and solving for $t$:
    $0=v\sin \theta -gt\;$
    $t={\frac {v\sin \theta }{g}}$ (rearrange and solve for $t$)
Now substitute into the vertical height equation 2a:
    $d_{v}=(v\sin \theta )t-{\frac {gt^{2}}{2}}=(v\sin \theta )({\frac {v\sin \theta }{g}})-{\frac {g({\frac {v\sin \theta }{g}})^{2}}{2}}={\frac {v^{2}{\sin }^{2}\theta }{g}}-{\frac {v^{2}{\sin }^{2}\theta }{2g}}={\frac {v^{2}{\sin }^{2}\theta }{2g}}$ (Equation 6a: max altitude for a given launch angle)

## Maximum range

Given the above range and altitude equations, the maximum range and altitude may be determined. Both equations for the range, equations 5 and 5a may be used to determine the maximum range by setting their derivatives to zero. For equation 5, range of the projectile is a function of $v_{h}$ and $v_{v}$ such that $v_{v}^{2}+v_{h}^{2}=v^{2}$ where v is the total initial velocity and is constant. Thus, the range may be expressed as a function of $v_{v}$ by solving for $v_{h}$:
    $v_{h}={\sqrt {v^{2}-v_{v}^{2}}}$ (Equation 8)
And substituting $v_{h}$ into equation 5:
    $d_{h}={{2v_{h}v_{v}} \over g}={{2v_{v}{\sqrt {v^{2}-v_{v}^{2}}}} \over g}$
The maximum $d_{h}$ may be determined by calculating the derivative and setting it to zero. The derivative is calculated as follows:
    ${\frac {d}{dv_{v}}}d_{h}={1 \over g}{\frac {d}{dv_{v}}}{2v_{v}{\sqrt {v^{2}-v_{v}^{2}}}}$
       $={1 \over g}(2{\sqrt {v^{2}-{v_{v}}^{2}}}+2v_{v}{\frac {d}{dv_{v}}}{\sqrt {v^{2}-v_{v}^{2}}}$ (application of product rule)
       $={1 \over g}(2{\sqrt {v^{2}-{v_{v}}^{2}}}+2v_{v}{\frac {d{\sqrt {v^{2}-v_{v}^{2}}}}{d{v_{v}}^{2}}}{\frac {d{v_{v}}^{2}}{dv_{v}}})$ (application of chain rule)
       $={1 \over g}(2{\sqrt {v^{2}-{v_{v}}^{2}}}+2v_{v}({\frac {-1}{2{\sqrt {v^{2}-{v_{v}}^{2}}}}})2v_{v})$ (derivative of square root)
       $={1 \over g}(2{\sqrt {v^{2}-{v_{v}}^{2}}}-{\frac {2{v_{v}}^{2}}{\sqrt {v^{2}-{v_{v}}^{2}}}})$ (simplify second term)
Set to zero and solve for $v$:
    $0={1 \over g}(2{\sqrt {v^{2}-{v_{v}}^{2}}}-{\frac {2{v_{v}}^{2}}{\sqrt {v^{2}-{v_{v}}^{2}}}})$
    ${\sqrt {v^{2}-{v_{v}}^{2}}}={\frac {{v_{v}}^{2}}{\sqrt {v^{2}-{v_{v}}^{2}}}}$
    $v^{2}-{v_{v}}^{2}=v_{v}^{2}$
    $v^{2}=2v_{v}^{2}$ (Equation 9)
Thus maximum range occurs when $v^{2}$ is $2v_{v}^{2}$ and this can be substituted back into equation 8:
    $v_{h}={\sqrt {v^{2}-v_{v}^{2}}}={\sqrt {v^{2}-v_{v}^{2}}}={\sqrt {2v_{v}^{2}-v_{v}^{2}}}=v_{v}$
Thus the maximum range occurs when $v_{h}=v_{v}$.
The actual maximum range may now be calculated by substituting $v_{h}=v_{v}$ and equation 9 into equation 5:
    $d_{h}={{2v_{h}v_{v}} \over g}={{2v_{v}v_{v}} \over g}={{2v_{v}^{2}} \over g}={v^{2} \over g}$

## Maximum range in polar coordinates

The same conclusion may be drawn by starting with equation 5a.
    ${\frac {d}{d\theta }}d_{h}={\frac {d}{d\theta }}{{v^{2}\sin 2\theta } \over g}$
       $={\frac {v^{2}}{g}}{\frac {d}{d2\theta }}\sin 2\theta {\frac {d2\theta }{d\theta }}$ (application of chain rule)
       $={\frac {v^{2}}{g}}(\cos 2\theta )2\quad$
Set to zero and solve for $\theta$:
    $0={\frac {v^{2}}{g}}(\cos 2\theta )2$
    $0=\cos 2\theta \quad$
Now cosine is zero at $\pi \over 2$:
    $2\theta ={\frac {\pi }{2}}$ (also directly clear from equation 5a, it gives the maximum possible sine value of 1)
    ${\theta }_{\max }={\frac {\pi }{4}}$ radians
Thus the maximum range occurs when the angle is 45 degrees.
The actual maximum range may now be calculated by substituting 45 degrees into equation 5a:
    $d_{h}={{v^{2}\sin 2\theta } \over g}={{v^{2}\sin 2({\frac {\pi }{4}})} \over g}={v^{2} \over g}$

## Maximum altitude at maximum range

Equations 6 and 6a may be used to calculate the maximum altitude at the maximum range. Equation 9 may be substituted into equation 6:
    $d_{v}={\frac {v_{v}^{2}}{2g}}={\frac {({\frac {v^{2}}{2}})}{2g}}={\frac {v^{2}}{4g}}$
Likewise 45 degrees may be substituted into equation 6a:
    $d_{v}={\frac {v^{2}{\sin }^{2}\theta }{2g}}={\frac {v^{2}({\frac {1}{\sqrt {2}}})^{2}}{2g}}={\frac {v^{2}}{4g}}$

## As a parabola

Equations 1 and 2 are parametric equations that describe a parabola. They may be rearranged into the more familiar quadratic form by solving equation 1 for $t$ and substituting into equation 2:
    $t={\frac {d_{h}}{v_{h}}}$ (rearrange equation 1 for $t$)
Substituting this into equation 2:
    $d_{v}=v_{v}t-{\frac {gt^{2}}{2}}=v_{v}({\frac {d_{h}}{v_{h}}})-{\frac {g({\frac {d_{h}}{v_{h}}})^{2}}{2}}=-{\frac {g}{2{v_{h}}^{2}}}(d_{h})^{2}+{\frac {v_{v}}{v_{h}}}(d_{h})$
This is now in the form
    $y=ax^{2}+bx+c\quad$
where
    $y=d_{v},x=d_{h},a=-g/{2{v_{h}}^{2}},b=v_{v}/v_{h},c=0$.
This is the form of a parabola and thus the trajectory is a parabola.
Likewise equations 1a and 2a can be rearranged into quadratic form. Equation 1a may be rearranged to:
    $t={\frac {d_{h}}{v\cos \theta }}$
And this may be substituted into equation 2a:
    $d_{v}=vt\sin \theta -{\frac {gt^{2}}{2}}=v\sin \theta {\frac {d_{h}}{v\cos \theta }}-{\frac {g{({\frac {d_{h}}{v\cos \theta }})}^{2}}{2}}$
Now $\tan \theta =\sin \theta /\cos \theta$, so:
    $d_{v}=-{\frac {g}{2v^{2}{\cos }^{2}\theta }}d_{h}^{2}+d_{h}\tan \theta$ (Equation 10)
This is again now in the form $y=ax^{2}+bx+c$ where $y=d_{v}\,$, $x=d_{h}\,$, $a=-g/{2v^{2}{\cos }^{2}\theta }\,$, $b=\sin \theta /\cos \theta$ and $c=0\,$ demonstrating that this is a parabola.
The quadratic formula gives the location of the intersection of the parabola and the x-axis. This is where the projectile trajectory starts and ends and thus may be used directly to calculate the range. In terms of rectilinear coordinate systems:
    $d_{h}={\frac {-b\pm {\sqrt {b^{2}-4ac\ }}}{2a}}={\frac {-(v_{v}/v_{h})\pm {\sqrt {(v_{v}/v_{h})^{2}-0}}}{2(-g/2v_{h}^{2})}}={\frac {-v_{v}/v_{h}\pm v_{v}/v_{h}}{-g/v_{h}^{2}}}=0,{\frac {2{v_{v}}{v_{h}}}{g}}\,$
This is the same result as equation 5 above.
In polar coordinates and using the trigonometric identity $2\sin \theta \cos \theta =\sin 2\theta \,$, the intersections are:
    $d_{h}={\frac {-b\pm {\sqrt {b^{2}-4ac\ }}}{2a}}={\frac {-(\sin \theta /\cos \theta )\pm {\sqrt {(\sin \theta /\cos \theta )^{2}-0}}}{2(-g/2v^{2}\cos ^{2}\theta )}}=0,{\frac {2\sin \theta /\cos \theta }{g/v^{2}\cos ^{2}\theta }}=0,{\frac {2v^{2}\sin \theta \cos \theta }{g}}=0,{\frac {v^{2}\sin 2\theta }{g}}\,$
This is the same result as in equation 5a above.
Similarly, the vertex of the parabola is the maximum altitude for a given range.

## Computer simulation

NCLab provides an interactive graphical module for projective motion with and without air friction. The Python source code of the simulation can be freely view and copied. For the case with air friction, Runge-Kutta methods of orders 1, 2 and 4 are used to solve the underlying ordinary differential equations.