Hello,
I am looking for a way to simulate rocket launch,
The rocket has fixed velocity, distance to the target is calculated.
How can i calculate the Angle needed for the shoot ?
I did try to work out the formula i find at wikipedia,
https://en.wikipedia.org/wiki/Trajectory_of_a_projectile
but i cant get the right results:
Angle required to hit coordinate x,y
var aAngle = Mathf.Atan( (v*v) + Mathf.Sqrt((v*v*v*v) - (g * ( g * (x*x) + 2 * h * (v*v)))) / g*x );
aAngle = aAngle * Mathf.Rad2Deg / 2;
print ("Angle => " + aAngle);
And This Part
→ Angle of reach
var newAngle = Mathf.Asin( x * g / (v*v) ) * 0.5;
print("newAngle => " + newAngle);
Any one know what am i doing wrong,
or have the currect way to achive the Angle for the launch ?
Thank you