Angle between two vectors

Math | Sunday 28 September 2008 7:49 pm

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);
Please share:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Current
  • LinkedIn
  • Live
  • MySpace
  • Netvibes
  • StumbleUpon
  • Twitter
  • Reddit
  • Technorati
  • Yahoo! Bookmarks

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment