Direction Cosines and Ratios
What You'll Learn
- 1Derive <MathBlock tex={`l^2 + m^2 + n^2 = 1`} /> from the coordinates of a point on the line
- 2Convert a triple of direction ratios into direction cosines including the correct sign
- 3Find the direction cosines of the line joining two given points
- 4Use the dot product of direction cosines to measure the angle between two lines
Two angles fix a line inside a plane, but a line in space needs three numbers, and they are tied together by one constraint. Direction cosines supply the constrained version, a unit vector along the line, while direction ratios supply the unconstrained version, any convenient triple proportional to it. This lesson derives the constraint from the distance formula, explains why direction ratios are not unique while direction cosines are, and works five numericals in the pattern CBSE sets.
Reading the Angles a Line Makes
Let a line pass through the origin and let , and be the angles it makes with the positive , and axes. Choose a point on the line at distance from the origin. Dropping perpendiculars to the three axes shows that the coordinates of are
The three quantities , and are the direction cosines, written , and . Any point on the line at distance from the origin therefore has coordinates , so the direction cosines are exactly the coordinates of the point where the line pierces the unit sphere.
Deriving the Fundamental Identity
The point sits at distance from the origin, so the distance formula gives . Dividing through by the non-zero number removes it completely:
That is the single constraint any valid triple must satisfy, and it is also the statement that direction cosines are the components of a unit vector. It follows that no component can exceed one in absolute value, and that at most two components can vanish, since three would sum to zero rather than one. The identity disqualifies any proposed triple that fails it, which makes it a favourite one-mark check.
Direction Ratios
Given , and , normalise them by dividing by their magnitude. Let ; then the direction cosines are
The formula reproduces the identity automatically, since . One caution is unavoidable: the triple , , describes an undirected line, so both and are legitimate answers. When the line is given as a directed segment from one point to another the signs are fixed by the order of the points; when only a ratio is quoted, both orientations should be mentioned.
| Property | Direction cosines | Direction ratios |
|---|---|---|
| Uniqueness | Unique for a fixed orientation | Not unique, any multiple works |
| Constraint | No constraint, any real triple | |
| Magnitude | Each component lies between minus one and one | Unbounded |
| Obtained from | Cosines of the axis angles, or normalising ratios | Coordinate differences, or by inspection |
| Role in a solution | Unit vector used for angles and projections | Convenient integer working data |
Direction Cosines of a Line Through Two Points
If a line joins to , its direction ratios are the coordinate differences and the distance between the points supplies the normalising denominator:
with and built from the and differences in the same way. Reversing the order of the points changes all three signs, which is the concrete instance of the ambiguity noted above. The same construction extends to the angle between two lines: if their direction cosines are and then
because the expression is the dot product of two unit vectors. Perpendicular lines therefore satisfy , while parallel lines have identical direction cosines up to a common sign.
Five Worked Numericals
What CBSE Asks Here
The chapter appears as a two-mark direct question and occasionally inside a longer three-dimensional problem. The most common form hands over three angles and asks for the direction cosines together with a verification of the identity, which is why the identity is worth deriving once rather than memorised. The second form gives direction ratios, sometimes with a negative component, and asks for the cosines; the negative value is where candidates slip. The third form asks for the equation of a line through a point that is parallel or perpendicular to a given line, which needs direction cosines before the point-direction form can be written. In the perpendicular case the dot product must vanish, and examiners frequently choose triples that make the arithmetic work out to zero, exactly as in the fifth numerical above. Errors concentrate in three places: forgetting to normalise a triple of ratios, dropping the sign of a negative component, and reporting a single value of when the square root admits two. A quick habit that prevents most of them is to verify every answer against the identity before moving to the next part of the question.
Checking the Arithmetic in Python
from math import sqrt, cos, radians, isclose
def from_angles(alpha, beta, gamma):
return (cos(radians(alpha)), cos(radians(beta)), cos(radians(gamma)))
def check(l, m, n, tol=1e-9):
total = l * l + m * m + n * n
print(f"l={l:9.6f} m={m:9.6f} n={n:9.6f} sum={total:.9f}")
assert isclose(total, 1.0, abs_tol=tol)
l, m, n = from_angles(60, 45, 60)
check(l, m, n)
ratios = (2, -3, 6)
R = sqrt(sum(r * r for r in ratios))
normalised = tuple(r / R for r in ratios)
print("normalised direction cosines:",
tuple(round(v, 5) for v in normalised))
check(*normalised)
from math import sqrt, acos, degrees
def from_two_points(p1, p2):
diffs = [b - a for a, b in zip(p1, p2)]
d = sqrt(sum(v * v for v in diffs))
return diffs, [v / d for v in diffs]
def dot(u, v):
return sum(a * b for a, b in zip(u, v))
dr1, dc1 = from_two_points((1, 2, 3), (4, 5, 6))
print("direction ratios of line 1:", dr1)
print("direction cosines of line 1:", [round(v, 5) for v in dc1])
print("sum of squares:", round(dot(dc1, dc1), 9))
dr2, dc2 = from_two_points((0, 0, 0), (2, 1, -2))
c = dot(dc1, dc2)
print("cos of the angle between the lines:", round(c, 9))
print("angle in degrees:", round(degrees(acos(max(-1, min(1, c)))), 4))
# recover a missing direction cosine
l, m = 1 / sqrt(2), 0.5
n_sq = 1 - l * l - m * m
print("possible values of n:", round(n_sq ** 0.5, 5),
"or", round(-(n_sq ** 0.5), 5))
Practice Set
- Find the direction cosines of a line making angles , and with the coordinate axes.
- Find the direction ratios of the line joining and .
- Convert the direction ratios to direction cosines.
- If and , find both possible values of .
- Show that the lines with direction ratios and are perpendicular.
Common Mistakes
Quoting direction ratios as if they were direction cosines
Fix: Divide every ratio by the square root of the sum of their squares before calling the result a direction cosine.
Dropping the sign of a negative ratio
Fix: Keep the minus sign through the normalisation, since <MathBlock tex={`m = -3/7`} /> encodes which side of the origin the line leans towards.
Giving only one root for the missing component
Fix: A line has two orientations, so <MathBlock tex={`n = \pm \dfrac{1}{2}`} /> unless the direction of travel is specified.
Key Takeaways
- Direction cosines are the components of a unit vector along the line, so they must satisfy <MathBlock tex={`l^{2} + m^{2} + n^{2} = 1`} />
- The identity comes from the distance formula applied to the point at distance <MathBlock tex={`r`} /> along the line, and the factor <MathBlock tex={`r^{2}`} /> cancels
- Direction ratios are any convenient proportional triple, which makes them non-unique but far easier to compute with
- The angle between two lines follows from the dot product of their direction cosines, with zero indicating perpendicularity