Direction cosine

In analytic geometry, the direction cosines (or directional cosines) of a vector are the cosines of the angles between the vector of interest and each of the three positive coordinate semiaxes. Equivalently, they are the contributions of each component of the basis to a unit vector in that direction.

Three-dimensional Cartesian coordinates

Vector v in ⁠ℝ3⁠
Direction cosines and direction angles for the unit vector 𝐯|𝐯|

If v is a Euclidean vector in three-dimensional Euclidean space, ⁠ℝ3,⁠

𝐯=vx𝐞x+vy𝐞y+vz𝐞z,

where ex, ey, ez are the standard basis in Cartesian coordinates notation, then the direction cosines are

α=cos⁡a=𝐯⋅𝐞x‖𝐯‖=vxvx2+vy2+vz2,β=cos⁡b=𝐯⋅𝐞y‖𝐯‖=vyvx2+vy2+vz2,γ=cos⁡c=𝐯⋅𝐞z‖𝐯‖=vzvx2+vy2+vz2.

It follows that by squaring each equation and adding the results

cos2a+cos2b+cos2c=α2+β2+γ2=1.

Here α, β, γ are the direction cosines and the Cartesian coordinates of the unit vector 𝐯|𝐯|, and a, b, c are the direction angles of the vector v.

The direction angles a, b, c are acute, right, obtuse, or straight angles, i.e., 0 ≤ a ≤ π, 0 ≤ b ≤ π and 0 ≤ c ≤ π (There are two opposite angles between two vectors, and the direction angle x between the vectors is the one satisfying 0 ≤ x ≤ π.), and they denote the angles formed between v and the unit basis vectors ex, ey, ez.

General meaning

More generally, direction cosine refers to the cosine of the angle between any two vectors starting at a same point. They are useful for forming direction cosine matrices that express one set of orthonormal basis vectors in terms of another set, or for expressing a known vector in a different basis. Simply put, direction cosines provide an easy method of representing the direction of a vector in a Cartesian coordinate system.

Applications

Determining angles between two vectors

Let u and v have direction cosines (αu, βu, γu) and (αv, βv, γv), respectively, having an angle θ between them. Their unit vectors are𝐮̂=ux‖𝐮‖𝐞x+uy‖𝐮‖𝐞y+uz‖𝐮‖𝐞z=αu𝐞x+βu𝐞y+γu𝐞z𝐯̂=vx‖𝐯‖𝐞x+vy‖𝐯‖𝐞y+vz‖𝐯‖𝐞z=αv𝐞x+βv𝐞y+γv𝐞zrespectively.

Taking the scalar product of these two unit vectors yield,𝐮̂⋅𝐯̂=αuαv+βuβv+γuγv.The geometric interpretation of the scalar product of these two unit vectors is equivalent to the projection of one vector onto another; linking the two definitions we find the following.

αuαv+βuβv+γuγv=cos⁡θ

There exist two choices for θ (because cosine is even); one is acute, right, obtuse, or straight angle (0 ≤ θ ≤ π), another is the reflex angle (π < θ < 2π), between the vectors. The convention is to choose the former, so we get θ from the scalar product by using the inverse cosine function:θ=arccos⁡(αuαv+βuβv+γuγv).

See also

References