It's been several years since I sat in a math lecture, so please bear with me.

Suppose I have a set of (non-equal) unit vectors S and an additional unit vector v. I want to know which of the vectors in S is closest to being the vector v. Stated differently, I want to know which vector in S forms the smallest angle with v.

I know the formula for the angle between two vectors, but quite frankly, I don't necessarily need the angle. I only need to know which one is most similar.

I know that the dot product of two vectors will be positive if the angle is acute and negative if the angle is obtuse, so can I assume that if they all have identical magnitudes (unit vectors) that the most positive dot product will be the most acute angle? In fact, as I'm thinking this through more, the cos of the angle should be equal to the dot product over the product of their magnitudes, so if the magnitudes are both 1, then the dot product should range from 1 to -1, with 1 indicating they are the same vector and -1 indicating they are exact opposites... am I on the right track here?

If it's relevant, this is all in a plane.

  • 3
    $\begingroup$ That's all correct. The dot product of two unit vectors is the cosine of the angle between them, so the larger the dot product, the smaller the angle. However, if want vectors pointing in opposite directions to be considered close, you may want to use the absolute value of the dot product. $\endgroup$
    – Unwisdom
    Feb 28, 2014 at 3:16
  • $\begingroup$ Thank you. I do not want opposite vectors to be considered close. I appreciate the confirmation :) $\endgroup$
    – burfl
    Feb 28, 2014 at 4:46
  • $\begingroup$ Also, if you want to make this an answer, I will gladly mark it accepted. Thanks again for your assistance. $\endgroup$
    – burfl
    Feb 28, 2014 at 5:47


You must log in to answer this question.

Browse other questions tagged .