[Math] Finding the angle and velocity to hit a target in t seconds

physics

My goal is to compute an angle + velocity combination to hit a target at point $(x,y)$ in exactly $t$ seconds. (Uniform gravity, no drag, no wind)

I know that the general formula for trajectory is:

$x = vt \cos \theta$,

$y = vt \sin \theta – \frac{1}{2} g t^2$.

But the problem is I think I can't solve the equation with only 2 inputs, $x$, $y$ and $t$.

Any ideas would be gladly appreciated, thank you for your brain time.

Best Answer

Note that $(v t\cos(\theta))^{2}+(vt\sin(\theta))^{2}=v^{2}t^{2}=x^2+(y+\frac{1}{2}gt^{2})^{2}$ which gives $$v=\frac{\sqrt{x^2+(y+\frac{1}{2}gt^{2})^{2}}}{t}$$ Now it is fairly easy to get $\theta$ from $x=vt\cos(\theta)$.

Related Question