Search found 1 match

by Gato
Tue Mar 06, 2007 4:20 am
Forum: Beginners Help
Topic: Finding the smallest arc of rotation for a vector
Replies: 4
Views: 404

To find the signed angle between two (2D) vectors, you can do something like the following: // the angle will be in RADIANS, from -Pi to Pi core::vector3df perp(-tempVector1.Y,tempVector1.X, 0.0); angle = atan2(perp.dotProduct(tempVector2), tempVector1.dotProduct(tempVector2)); To rotate a 2D vector...