I assume that its gravity acts on the vertical axis and that its launch angle is an altitude (measured vertically from the horizon, so 0 ° means to shoot horizontally and 90 ° means to shoot upwards). Our turret can still turn on the azimuth (from side to side) to follow the target and intercept it if it moves laterally.

The first thing we will do is take the absolute objective position $ vec p_T $ and launch position $ vec p_L $ build a relative target position vector $ vec r $, and its projection in the horizontal plane $ vec r_h $ and vertical axis $ r_v $:

$$ begin {align}

vec r & = vec p_T – vec p_L \

r_v & = vec r cdot vec {top} \

vec r_h & = vec r – r_v vec {top}

end {align} $$

This allows us to take the throwing position directly out of the equation. We can apply the second and third steps to the target velocity vector $ vec v $ divide it into a horizontal vector $ vec v_h $ and a vertical component $ v_v $.

Now, if we want to reach the goal at an initially unknown moment $ t $ seconds after launch, we will have to cover the horizontal offset $ vec r_h + vec v_h t $ straight in time $ t $. So, the horizontal component of our launch speed $ vec l_h $ is:

$$ vec l_h = frac { vec r_h + vec v_h t} t $$

Given our desired launch angle $ theta $, we know that the relationship between horizontal and vertical launch speeds is:

$$ begin {align}

tan theta & = frac {l_v} { | vec l_h |} \

tan theta cdot | vec l_h | & = l_v \

tan ^ 2 theta cdot l_h ^ 2 & = l_v ^ 2 \

tan ^ 2 theta left ( frac { vec r_h + vec v_h t} t right) ^ 2 & = l_v ^ 2 \

tan ^ 2 theta left ( frac {r_h ^ 2} {t ^ 2} + 2 frac { vec r_h cdot vec v_h} t + v_h ^ 2 right) & = l_v ^ 2

end {align} $$

Now we want to know if that vertical launch speed will take us to the height of our goal at the end of the arc at the moment $ t $:

$$ begin {align}

l_v t – frac g 2 t ^ 2 & = r_v \

l_v & = frac {r_v} t + frac g 2 t \

l_v ^ 2 & = frac {r_v ^ 2} {t ^ 2} + r_v g + frac {g ^ 2} 4 t ^ 2 \

tan ^ 2 theta left ( frac {r_h ^ 2} {t ^ 2} + 2 frac { vec r_h cdot vec v_h} t + v_h ^ 2 right) & = frac {r_v ^ 2} {t ^ 2} + r_v g + frac {g ^ 2} 4 t ^ 2 \

tan ^ 2 theta left (r_h ^ 2 + 2 vec r_h cdot vec v_h t + v_h ^ 2 t ^ 2 right) & = r_v ^ 2 + r_v gt ^ 2 + frac {g ^ 2 } 4 t ^ 4 \

t ^ 4 left ( frac {g ^ 2} 4 right)

+ t ^ 2 left (r_v g – left ( tan theta right) ^ 2 v_h ^ 2 right)

– t left (2 left ( tan theta right) ^ 2 vec r_h cdot vec v_h right)

– left ( tan theta right) ^ 2 r_h ^ 2

& = 0

end {align} $$

We now have a quantum equation in a variable with known real number coefficients. As described in this answer, you can apply your favorite quantum resolution routine (there is an example in the comments) to find potential values of $ t $ that satisfy the equation In general, there could be up to four solutions. We are only looking for those who are …

- real numbers (zero imaginary component)
- greater than zero (negative values correspond to shots
*objective* could have thrown at *we* to hit us at our launch angle at time 0)

If you have multiple candidate solutions that meet those criteria, you can freely choose between them. Generally, the lower the time value $ t $ The more shallow the arch, but also less time has the goal to change course and dodge. Higher $ t $ The solutions generally correspond to higher arcs (we spend more time flying up and down through the air), giving the target more time to evade.

With the chosen time $ t $ In your hand, you can substitute it in the previous equations to find your horizontal and vertical launch speed components, and combine them into the final speed.