Sign in to follow this  

Can dot() on two normalized vectors be greater than 1

This topic is 2633 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

The dot product can be expressed by |A|*|B|*cos(ThetaAB). |A| and |B| are both 1, and cos(ThetaAB) never exceeds 1, so the answer is "no." Of course, this is neglecting rounding error.

Share this post


Link to post
Share on other sites
Since you've been given some different answers here, let me reinforce what Rycross and no such user have said, which is that assuming some sort of floating-point representation is being used, the answer to your question is yes. If you want your code to be robust, in most cases you'll need to take this into consideration.

Share this post


Link to post
Share on other sites
Yes, just to clarify, I was specifying that mathematically it would not come out greater than 1. In practice, you will need to accommodate floating point rounding errors, which may cause the result to be greater than 1.

Share this post


Link to post
Share on other sites

This topic is 2633 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