#### Archived

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

# Angle between Vectors

This topic is 5922 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 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 on other sites

This topic is 5922 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

This topic is now closed to further replies.

1. 1
2. 2
3. 3
Rutin
22
4. 4
JoeJ
17
5. 5

• 14
• 30
• 13
• 11
• 11
• ### Forum Statistics

• Total Topics
631774
• Total Posts
3002295
×