Angle between two vectors
Here’s the formula to get the angle between two vectors in 2D space.
vector2 diff = target - position; float angle = atan2(diff.y, diff.x); |
No Comments »
No comments yet.
RSS feed for comments on this post. TrackBack URI
Here’s the formula to get the angle between two vectors in 2D space.
vector2 diff = target - position; float angle = atan2(diff.y, diff.x); |
No comments yet.
RSS feed for comments on this post. TrackBack URI