Direction cosines and ratios
Every line drifting through three-dimensional space has a "tilt" against the coordinate axes, and that tilt can be pinned down with three numbers. Point a line from the origin toward and it leans a certain amount toward each axis — direction cosines and direction ratios are simply two ways of writing that lean, one normalised, one raw. This short topic opens the Three-Dimensional Geometry unit of ISC Class 12 Mathematics, and every later formula in the chapter — the equation of a line, the angle between two lines, the shortest distance between skew lines — is built directly on top of it. Master the conversion between ratios and cosines, the identity they satisfy, and the cosine formula for the angle between two lines, and the rest of the chapter becomes mostly bookkeeping.
Direction cosines are the cosines of the angles a line makes with the -, -, -axes and always satisfy , while direction ratios are any triple proportional to them, so dividing by turns ratios into cosines and the same dot-product idea gives the angle between two lines.
The core idea
Take a directed line in space, making angles with the positive -, -, -axes. Its direction cosines are the cosines of those angles:
where: are each confined to , since they are genuine cosines. They are never independent — they always obey the fundamental identity
so fixing any two (up to a sign choice for the third) pins the line's direction completely.
Ratios versus cosines. Any triple proportional to — that is, , , for some non-zero — is called a set of direction ratios. Ratios are what you read off a diagram or a pair of points without touching a square root; cosines are the normalised version you need whenever an actual angle or unit vector is wanted. Converting one to the other is one division:
where: is the magnitude of the ratio triple, playing the role of a normalising length.
Direction ratios from two points. For and , the direction ratios of line are read off directly:
No square root is needed until cosines are specifically asked for. The figure below shows a line's direction cosines as the cosines of the three angles it makes with the axes, and the equivalent, unnormalised direction ratios sitting alongside as a scaled version of the same direction.
Angle between two lines. If two lines have direction cosines and , or direction ratios and , the angle between them satisfies
where: the numerator is a dot-product-style sum and the denominator is the product of the two ratio triples' magnitudes, so the formula works whether you start from cosines or from raw ratios. Two immediate special cases follow from it:
A line (as opposed to a directed ray) has direction cosines only up to an overall sign, since and describe the same line pointing the opposite way.
The goal is to derive the cosine formula for the angle between two lines starting from nothing but the definition of direction cosines and the ordinary cosine rule already known from Class 11 trigonometry, so that the formula used in every later 3-D geometry problem is not just memorised but seen to follow from first principles.
Step 1. Represent each line by a unit vector along its direction. If line 1 has direction cosines , the unit vector along it is , and likewise for line 2. Both vectors have length because and similarly for the second line — this is exactly the identity stated above, now put to use.
Step 2. Translate both lines so they pass through a common origin, which does not change the angle between them, and drop a perpendicular to form a triangle with the two unit vectors as two sides and the segment joining their tips as the third side. By the distance formula, the squared length of that third side is .
Step 3. Apply the cosine rule to the triangle formed by , and the angle between them: the third side squared equals , since both unit vectors have length .
Step 4. Equate the two expressions for the third side's squared length and expand the left side. expands to . Using and , the left side becomes .
Step 5. Cancel the matching on both sides to read off . Replacing by their ratio expressions and so on gives the full direction-ratio version stated above, and setting recovers the perpendicularity condition immediately.
Worked example
Find the direction cosines of the line joining and , then use them to find the angle this line makes with the line through the origin having direction ratios .
Step 1. Direction ratios of : subtract coordinates, , , .
Step 2. Magnitude: .
Step 3. Normalise to get the direction cosines: , , . Check: , confirming the identity holds.
Step 4. Angle with the line through the origin, using the ratio form of the cosine formula directly on and :
Step 5. Since is negative, is obtuse; the acute angle between the two lines is , and neither the parallel nor the perpendicular condition holds here since and the ratios are not equal. The direction cosines of are , and the angle it makes with is , an obtuse angle.
Common traps
- Confusing direction cosines (unique up to sign, satisfy ) with direction ratios (any proportional triple, no normalisation condition) — giving when cosines were asked for is an incomplete answer.
- Getting the subtraction order wrong ( instead of ) — this flips every ratio's sign, which represents the same line but the opposite orientation, and can flip the sign of a computed angle if not tracked carefully.
- Forgetting the denominator's product of magnitudes in the angle formula — a common slip that produces , an impossible value that signals an arithmetic error.
- Mixing up parallel and perpendicular conditions — proportional ratios mean parallel, a vanishing dot-product sum means perpendicular; treating one condition as the other is a frequent conceptual error.
Ask the tutor: want to see one more angle-between-lines problem worked end to end, or a walkthrough of why the identity always holds for any direction — just ask.
Why do direction cosines need the identity l squared plus m squared plus n squared equals 1 but direction ratios do not?
Because are literal cosines of the angles a unit-length direction vector makes with the axes, and for any unit vector the sum of the squares of its components along perpendicular axes always equals — this is really the distance formula applied to a vector of length one. Direction ratios are only proportional to , scaled by some factor , so their squares sum to rather than . That is exactly why you divide by to convert ratios into cosines — the division removes the scale factor and restores the unit-length condition.
If a question gives me direction ratios, do I always need to convert to direction cosines first?
No. The angle-between-lines formula, and the parallel and perpendicular conditions, all work directly on raw direction ratios without ever normalising them — that is precisely why ratios are convenient for quick computation. You only need to convert to direction cosines when the question specifically asks for cosines, or when you need a genuine unit vector along the line, for instance to write the vector form of a line's equation later in the chapter.
Why can a line have two different sets of direction cosines that look like negatives of each other?
A line by itself has no built-in direction of travel, so and both describe it equally well — they are the two ways of walking along the same line. This only becomes an issue if a question is careless about order: computing direction ratios as instead of silently swaps you from one valid set to the other. The underlying line, its parallel and perpendicular relationships with other lines, and the unsigned angle it makes with any other line are unaffected either way.