1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Calculating the angle between two vectors

  1. Aug 6, 2010 #1
    When calculating the angle between two vectors, I take the inverse cosine of the dot product of the two vectors normalized. This gives me the angle, however this does not specify whether the direction is backwards or forwards. In other words, it'll give me a range of -PI/2 to PI/2, then it loops back. Is there a way to figure out the angle in range of 0 to 360 degrees with this?
  2. jcsd
  3. Aug 6, 2010 #2
    Usually (for how it is normally defined, for example, in calculators) the cos^(-1) gives back values belonging to [0, pi], not [-pi/2 , pi/2] because in this interval the cos is not invertible.

    Lets consider R^3.
    If you want an angle between two normalized vectors u and v, belonging to [0, 2pi[, you have to define an orientation z for the plane where the two vectors are (the vector z lies in one side or the other of the plane, you choose).

    (1) calculate alpha = cos^(-1) (u.v)
    (2) calculate w = u x v
    (3) if w.z > 0 or w.z = 0 then the answer is alpha
    (4) if w.z < 0 then the answer is 2pi - alpha
  4. Aug 6, 2010 #3


    User Avatar
    Science Advisor

    The "angle between two vectors" is, by definition, the smaller of the two angles formed by the intersection of lines in the direction of the two vectors. The angle between two vectors is always between 0 and [itex]\pi[/itex].
  5. Aug 6, 2010 #4
    Nevertheless, if you need it, you can define the angle in (0, 2pi), and to do so you have to decide an orientation.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook