Direction cosines

We can find the angle between two nonzero vectors using the dot product:

uv=|u||v|cosθcosθ=uv|u||v|.

Often, we want to determine the angle that a certain vector makes with the coordinate axes. To do this, we just put i^, j^, and k^ in the place of v one at a time and solve for the angle. Since this operation is so common, it is worthwhile to work out specific equations.

Let’s start with the x-axis. If we have a vector u in component form, then

cosθ=ui^|u||i^|=[u1,u2,u3][1,0,0]|u|(1)=u1|u|.

When we dot u with one of the standard basis vectors, we are effectively choosing one of its components. Simplifying the equation for the other two axes is just as easy. To avoid confusion, we use three different Greek letters to represent the three angles:

Axis Basis Cosine Value
x i^ cosα u1/|u|
y j^ cosβ u2/|u|
z k^ cosγ u3/|u|