Finding the angle when throwing a ball to hit a target

1k Views Asked by At

For my game, I need to find the angle to shoot a projectile so that it hits the target (think Angry Birds). Assume that the projectile is launched at origin (0, 0), the target is at (x1, y1), initial speed is v, gravity is g (-9.8 m/s^2), and the angle is t. No air drag. I managed to derive this equation where we must solve for t.

$y_1 \cos^2 t - x_1 \sin t \cos t - {x_1^2 g \over 2v^2} = 0$

I have tried many trigonometric substitutions but there is always both sin something and cos something! If only I could express the equation above entirely in terms of either cos something or sin something, I would be able to solve it.

Can someone give me help here? Thanks a lot.