Given a coordinate and the launch speed, I need to determine which pair of angle, or angle allows a hit on said coordinate. I know, let's say, the common way, which is using the following equations:
$ x = V_ocos(\theta)t $ $ y = V_osen(\theta)t - \frac{gt^2}{2} $
And after removing the parameter:
$ y = tan(\theta)x - \frac{gx^2}{2{V_o}^2cos^2\theta} $
And solving for $tan(\theta)$: $ tan(\theta) = \frac{\frac{2{V_o}^2}{gx} \pm \sqrt{(\frac{2{V_o}^2}{gx})^2 - 4(\frac{gx^2+{2V_o}^2}{gx^2})}} {2} $
Now, that's big, plus there's too much margin for error. Do you know a better way to calculate the angle(s) of launch which hits $(x,y)$?
Thanks.