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 in , the direction cosines are , , and , where , , and are the angles between and the positive -, -, and -axes respectively. These satisfy the identity .
Key Formula
Where:
- = Components of the vector along the x-, y-, and z-axes
- = Angles the vector makes with the positive x-, y-, and z-axes
- = 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 and , 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 .
Find the magnitude: Compute the length of the vector.
Compute each direction cosine: Divide each component by the magnitude.
Find the angles: Take the inverse cosine of each value.
Answer: The direction cosines are , , and , with direction angles approximately , , and .
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 and . Always divide each component by first — the direction cosines are the components of the unit vector, not the original vector.
