# Shooting a cannon downhill

The question: If you are on a downhill slope with angle $\alpha$, what’s the optimum angle to fire a projectile to get the maximum range?

This was a Reddit question. I was surprised at how simple the answer turned out to be.

Introductory physics projectile problems almost always involve firing a projectile on flat ground. The final height is the same as the initial height. Things get rapidly messy pretty quickly if you get away from that situation.

For instance it’s well known that the range of a projectile on flat ground, launched with speed $v$ at angle $\theta$, is

$\displaystyle R = \frac{v^2 \sin(2\theta)}{g}$

It’s pretty easy to derive this (which I do below) and show that the optimum angle is $45^\circ$.

But when the starting height is $h$, different from the final height of $0$, things get a little more complicated:

$\displaystyle R = \frac{v}{g} \cos(\theta) \left( v \sin(\theta) + \sqrt {v^2 \sin^2(\theta) + 2gh} \right )$

I’m not going to bother deriving that one.

Complicating things even more, when you fire on a slope, you don’t have a fixed ending height. The height is different at different ranges. So you’d think that complicates the equations even more. Amazingly, the expression for optimum angle turns out to be surprisingly simple. If the slope angle is $\alpha$, then

$\displaystyle \theta_{opt} = 45^\circ - \frac{\alpha}{2}$

Let’s dive in.

#### Range of a projectile on flat ground

I always advise “do the physics first before writing any equations”. That means figure out what’s happening qualitatively, what principles are in operation. Once you’ve got that, you have some idea what equations to apply.

How do we find the range? The range is the distance it travels horizontally until it stops. Well, why does it stop? Because it hits the ground. The projectile will keep moving until $\bf{y = 0}$.

So now we know what the equations have to tell us: when does $y = 0$? and how far has it gone?

The standard method in projectile problems is to separate the motion into x and y components. For the vertical motion, we will define positive values as upward. (You always have a choice on this). That means the acceleration, which is downward, is -g. If the initial velocity is $v$ at angle $\theta$ relative to the horizontal, the initial vertical velocity is $v_{0y} = v sin(\theta)$. Since we’re on flat ground, the initial displacement is $y _0 = 0$. So

$\displaystyle y = y_0 + v_{0y} t + \frac{1}{2} a_y t^2 \\[9 pt] = vt \sin(\theta) - \frac{1}{2} g t^2$

We’re going to use this equatioin to ask, “when is $y = 0$“? That is, we’ll set $y = 0$ and solve for $t$. Then we’ll figure out what $x$ is at that time. That’s our range.

The horizontal motion experiences no acceleration, $a = 0$. The initial horizontal velocity (which remains constant) is $v_0 = v cos(\theta)$. And the initial position is $x_0 = 0$. So for the horizontal motion

$\displaystyle x = x_0 + v_{0x} t + \frac{1}{2} a_x t^2 \\[9 pt] = vt \cos(\theta)$

So now let’s solve it. First, when is $y = 0$?

$\displaystyle 0 = vt\,\sin(\theta) - \frac{1}{2} g t^2 \\[9pt] = t \left (v\,\sin(\theta) - \frac{1}{2} g t \right )\\[9pt] t = 0\enspace \text{or} \enspace v\,\sin(\theta) - \frac{1}{2} g t = 0 \\[9pt] t = 0\enspace \text{or} \enspace t = \frac{2 v\,\sin(\theta)}{g}$

We know $y$ was $0$ at $t = 0$, that’s our starting point. We’re interested in the other solution. So what is $x$ at that time?

$\displaystyle x = vt\,\cos(\theta) = v\,\cos(\theta)\frac{2 v\,\sin(\theta)}{g} = \frac {2v^2\,\sin(\theta) \cos(\theta)}{g}$

This value of x is our range R. Now we can use the double-angle formula $\sin(2\theta) = 2\sin(\theta) \cos(\theta)$, so

$\displaystyle R = \frac {v^2 \sin(2\theta)}{g}$

What’s the optimum angle? The maximum value of sine is 1, and that happens when the argument is 90 degrees. So the maximum range is when $\bf{2\theta = 90^\circ}$ or $\bf{\theta = 45^\circ}$.

#### Shooting downhill

The situation is shown in the figure below.

The projectile is fired from the top of a downhill slope. The slope has angle $\alpha$ below the horizontal, and the projectile’s initial velocity $v$ is at angle $\theta$ above the horizontal. At the landing point, the value $y$ (a negative number) is the final vertical displacement relative to the starting point, and $R$ is the final horizontal displacement.

Where does it land? What are $R$ and $y$? Again, first ask yourself, why does it stop? It stops because it hits the ground, in this case the slope.

So the trajectory ends when the $y$ value of the trajectory meets the y value of the slope. And there’s the key physical principle. So if we can write equations for the $y$ value of the trajectory and the $y$ value of the slope, the end point is when and where those are equal.

It’s not hard to see that $y$ value of the slope is given in terms of $x$ by $\tan(\alpha) = -y/x$ or $y = - x \,\tan(\alpha)$. The minus sign is because we have chosen to define $\alpha$ as a positive quantity while $y$ is negative.

The $y$ value of the trajectory is, as usual for projectile problems

$\displaystyle y = vt\,\sin(\theta) - \frac{1}{2}g\:t^2$

where $t$ is the time of flight. So the horizontal range is

$\displaystyle R = vt\,\cos(\theta)$

or

$\displaystyle t = \frac{R}{v\,\cos(\theta)}$

Setting the trajectory $y$ equal to the slope $y$ and substituting the above expression for $t$, we can solve for $R$.

$\displaystyle y = vt\,\sin(\theta) - \frac{1}{2}g\,t^2 = -R\,\tan(\alpha) \\[9pt] v\,\sin(\theta) \left (\frac{R}{v\,\cos(\theta)} \right ) - \frac{g}{2}\left( \frac{R^2}{v^2\,\cos^2(\theta)} \right) = -R\,\tan(\alpha) \\[9pt] 2v^2R\: \frac{\sin(\theta)}{\cos(\theta)} - \frac{g R^2}{\cos^2(\theta)} = -2 R v^2\,\tan(\alpha) \\[9pt] [2v^2\: \sin(\theta)\cos(\theta)]R - g R^2 = -2v^2\,\tan(\alpha) \cos^2(\theta) R\\[9pt] [2v^2\: \sin(\theta)\cos(\theta) + 2v^2\,\tan(\alpha) \cos^2(\theta) ]R - g R^2 = 0\\[9pt] R [2v^2\: \sin(\theta)\cos(\theta) + 2v^2\,\tan(\alpha) \cos^2(\theta) - g R] = 0\\[9pt] R [v^2\: \sin(2\theta) + 2v^2\,\tan(\alpha) \cos^2(\theta) - g R] = 0$

The two points where the trajectory intersects the slope are where $R = 0$ and where $v^2\: \sin(2\theta) + 2v^2\,\tan(\alpha) \cos^2(\theta) - g R = 0$ or

$\displaystyle R = \frac{v^2}{g}\: [\sin(2\theta) + 2\tan(\alpha) \cos^2(\theta)]$

That gives the horizontal range for any launch angle $\theta$. What is the optimum value of $\theta$? We take the derivative with respect to $\theta$, remembering that $\alpha$ is a constant, so

$\displaystyle \frac{dR}{d\theta} = \frac{v^2}{g}\: [2 \cos(2\theta) - 4\tan(\alpha) \cos(\theta) \sin(\theta)] = 0 \\[9pt] 2 \cos(2\theta) = 4\tan(\alpha) \cos(\theta) \sin(\theta) = 2\tan(\alpha) \sin(2\theta) \\[9pt] \frac{\cos(2\theta)}{\sin(2\theta)} = \tan(\alpha) \\[9pt] \cot(2\theta) = \tan(\alpha)$

All the angles are acute angles, so this tells us that $2\theta$ and $\alpha$ are complements. (Think about the two acute angles in a right triangle. The adjacent for one is the opposite of the other, and vice versa, so opposite/adjacent for one is adjacent/opposite for the other.)

Thus $2\theta = 90^\circ - \alpha$ and the optimum firing angle is $\theta = 45^\circ - \frac{\alpha}{2}$.