Archived

This topic is now archived and is closed to further replies.

Booba

Angle between Vectors

Recommended Posts

I have a function to calculate the geometrical angle between two vectors : double AngleBetweenVectors(CVector3 Vector1, CVector3 Vector2) { // Get the dot product of the vectors float dotProduct = Dot(Vector1, Vector2); // Get the product of both of the vectors magnitudes float vectorsMagnitude = Magnitude(Vector1) * Magnitude(Vector2) ; // Get the angle in radians between the 2 vectors double angle = acos( dotProduct / vectorsMagnitude ); // Return the angle in radians return( angle ); } but I want to calculate the angle *directed*, I don''t know if it''s the good word in English ( "angle orienté" en Français =) but I want to have an angle according to the direction of the vectors therefore to have negative angles. How can I do that ?? Thanks.

Share this post


Link to post
Share on other sites
Crosspost. It's already been been answered in the first (and correct) forum that you posted the message in.

EDIT: Looking at your profile I see you crosspost alot. Don't, you'll actually get a better answer by allowing repsondents to converse with each other rather than splitting them up by which ever forum they visit first. (Also notice that the best replies come from the forum that the message was meant for, ie. OpenGL questions get answered best in the OpenGL forum, rather than the general one).

[edited by - Michalson on May 5, 2002 12:37:31 PM]

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.