How to find direction cosines and direction angles of a vector
A vector in three dimensions makes an angle with each positive coordinate axis. We’ll find those angles from the vector’s components, then use the same idea to find a third angle when we know the first two.
Divide each component by the magnitude
For a nonzero vector , let , , and be the angles with the positive -, -, and -axes. Each angle is between and radians. Dividing by the magnitude gives the unit vector in the same direction.
Each component of that unit vector is the cosine of the angle with its axis.
Those three numbers are the direction cosines. Take the inverse cosine of each one to get the direction angles.
Find the direction angles of a vector
For , the magnitude is . Use that magnitude in all three fractions.
Find the third angle from the other two
The direction cosines are components of a unit vector. Its length is one, so the squares of the three components add to one.
If and , the first two squared cosines are and .
Dividing by the length also appears when we project one vector onto another. See scalar and vector projections.