Sign in to follow this  

Vector dot product

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to use vector dot product to get the angle between two vectors, but I'm puzzled by the results.

 

Given two vectors, A and B:

A(0.0, 0.2, 0.0)
B(0.8, 0.0, 0.0)

The angle between those, calculated with the dot product:

alpha= (acos(A*B)) * RAD_TO_DEG

properly returns 90°.

Now, let's have two vectors pointing in the same direction:

A(0.2, 0.2, 0.0)
B(0.8, 0.8, 0.0)

Would you guys explain me why in this case alpha is equal to 9.9°, while I'd expect to return 0°? Thanks

 

 

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this