Mathwords logoMathwords

Direction Cosine — Definition, Formula & Examples

A direction cosine is the cosine of the angle that a vector makes with one of the coordinate axes. Every vector in 3D space has three direction cosines — one for each axis — and together they describe the vector's orientation.

Given a nonzero vector v=a,b,c\mathbf{v} = \langle a, b, c \rangle in R3\mathbb{R}^3, the direction cosines are cosα=av\cos\alpha = \dfrac{a}{\|\mathbf{v}\|}, cosβ=bv\cos\beta = \dfrac{b}{\|\mathbf{v}\|}, and cosγ=cv\cos\gamma = \dfrac{c}{\|\mathbf{v}\|}, where α\alpha, β\beta, and γ\gamma are the angles between v\mathbf{v} and the positive xx-, yy-, and zz-axes respectively. These satisfy the identity cos2α+cos2β+cos2γ=1\cos^2\alpha + \cos^2\beta + \cos^2\gamma = 1.

Key Formula

cosα=aa2+b2+c2,cosβ=ba2+b2+c2,cosγ=ca2+b2+c2\cos\alpha = \frac{a}{\sqrt{a^2+b^2+c^2}},\quad \cos\beta = \frac{b}{\sqrt{a^2+b^2+c^2}},\quad \cos\gamma = \frac{c}{\sqrt{a^2+b^2+c^2}}
Where:
  • a,b,ca, b, c = Components of the vector along the x-, y-, and z-axes
  • α,β,γ\alpha, \beta, \gamma = Angles the vector makes with the positive x-, y-, and z-axes
  • a2+b2+c2\sqrt{a^2+b^2+c^2} = Magnitude (length) of the vector

How It Works

To find the direction cosines of a vector, divide each component by the vector's magnitude. The resulting values each lie between 1-1 and 11, just like any cosine. Because the direction cosines form the components of the corresponding unit vector, their squares always sum to 1. In two dimensions the same idea applies, but you only have two direction cosines instead of three.

Worked Example

Problem: Find the direction cosines and direction angles of the vector v=1,2,2\mathbf{v} = \langle 1, 2, 2 \rangle.
Find the magnitude: Compute the length of the vector.
v=12+22+22=9=3\|\mathbf{v}\| = \sqrt{1^2 + 2^2 + 2^2} = \sqrt{9} = 3
Compute each direction cosine: Divide each component by the magnitude.
cosα=13,cosβ=23,cosγ=23\cos\alpha = \frac{1}{3},\quad \cos\beta = \frac{2}{3},\quad \cos\gamma = \frac{2}{3}
Find the angles: Take the inverse cosine of each value.
α=cos1 ⁣(13)70.5°,β=cos1 ⁣(23)48.2°,γ48.2°\alpha = \cos^{-1}\!\left(\tfrac{1}{3}\right) \approx 70.5°,\quad \beta = \cos^{-1}\!\left(\tfrac{2}{3}\right) \approx 48.2°,\quad \gamma \approx 48.2°
Answer: The direction cosines are 13\tfrac{1}{3}, 23\tfrac{2}{3}, and 23\tfrac{2}{3}, with direction angles approximately 70.5°70.5°, 48.2°48.2°, and 48.2°48.2°.

Why It Matters

Direction cosines appear in physics and engineering whenever you need to decompose forces or velocities along coordinate axes. In computer graphics, they help define surface normals and lighting angles. They are also central to rotation matrices in linear algebra and robotics.

Common Mistakes

Mistake: Forgetting to divide by the magnitude and instead using the raw components as direction cosines.
Correction: Direction cosines must each be between 1-1 and 11. Always divide each component by v\|\mathbf{v}\| first — the direction cosines are the components of the unit vector, not the original vector.