I’m trying to calculate the angular direction of a projectile, knowing it’s X and Y velocity I can find the magnitude of its movement, but I’m having a hard time wrapping my mind around getting the angular direction (in radians) that it is moving…
I assume there is a tan or a sin involved, but I’m a bit clueless otherwise…
You might be interested in
Math.atan2.Given an
xandyaround the origin, it will return the angle. E.g.It does take the direction into account, so you don’t have to worry about
1 / 1or-1 / -1(which would normally result in the same angle).