Direction Cosines &
Direction Ratios
Master the fundamental language of 3D space — how lines orient themselves relative to the three coordinate axes.
Introduction
In 3D coordinate geometry, a point is represented as $(x, y, z)$ with respect to three mutually perpendicular axes $OX$, $OY$, $OZ$. The direction of a line in 3D space is characterised by the angles it makes with these axes.
Unlike 2D where a single slope describes direction, in 3D we need three angles — giving rise to direction cosines and direction ratios.
Direction Cosines of a Line
If a line makes angles $\alpha$, $\beta$, $\gamma$ with the positive directions of the $x$-axis, $y$-axis, and $z$-axis respectively, then the cosines of these angles are called the direction cosines (DCs) of the line.
where $\alpha, \beta, \gamma$ are direction angles ($0 \le \alpha,\beta,\gamma \le \pi$)
| Line / Axis | $\alpha$ (with $x$) | $\beta$ (with $y$) | $\gamma$ (with $z$) | DCs $(l, m, n)$ |
|---|---|---|---|---|
| $x$-axis | $0°$ | $90°$ | $90°$ | $(1,\ 0,\ 0)$ |
| $y$-axis | $90°$ | $0°$ | $90°$ | $(0,\ 1,\ 0)$ |
| $z$-axis | $90°$ | $90°$ | $0°$ | $(0,\ 0,\ 1)$ |
| Equally inclined to all axes | $\cos^{-1}\!\tfrac{1}{\sqrt{3}}$ | $\cos^{-1}\!\tfrac{1}{\sqrt{3}}$ | $\cos^{-1}\!\tfrac{1}{\sqrt{3}}$ | $\left(\pm\tfrac{1}{\sqrt{3}},\pm\tfrac{1}{\sqrt{3}},\pm\tfrac{1}{\sqrt{3}}\right)$ |
Fundamental Relation
Let $P(x, y, z)$ be any point on the line and $r = |OP|$. The foot of perpendicular from $P$ to the $x$-axis has distance $x$, so $\cos\alpha = x/r$. Similarly $\cos\beta = y/r$, $\cos\gamma = z/r$. Therefore:
$$l^2+m^2+n^2 = \frac{x^2+y^2+z^2}{r^2} = \frac{r^2}{r^2} = 1 \quad\checkmark$$- $\sin^2\!\alpha + \sin^2\!\beta + \sin^2\!\gamma = 2$ (since $1-\cos^2\theta$ for each, sum = $3-1=2$)
- $\cos 2\alpha + \cos 2\beta + \cos 2\gamma = -1$ (using $\cos 2\theta = 2\cos^2\theta -1$)
- Each DC is in the range $[-1,\ 1]$
- If $l=m=n$, then $3l^2=1 \Rightarrow l = \pm\dfrac{1}{\sqrt{3}}$
Direction Ratios
Any three numbers $a, b, c$ which are proportional to the direction cosines $l, m, n$ are called direction ratios (DRs) of the line.
| Property | Direction Cosines | Direction Ratios |
|---|---|---|
| Uniqueness | Unique (up to ± sign) | Not unique — any proportional set works |
| Constraint | $l^2+m^2+n^2 = 1$ | No constraint |
| Range | Each $\in[-1,1]$ | Any real numbers |
| Example | $\left(\frac{2}{7}, -\frac{3}{7}, \frac{6}{7}\right)$ | $(2,-3,6)$ or $(4,-6,12)$ etc. |
Converting Direction Ratios to Direction Cosines
Given direction ratios $(a, b, c)$, find direction cosines by dividing each by $\sqrt{a^2+b^2+c^2}$:
The $\pm$ sign corresponds to the two opposite directions along the line.
Line Joining Two Points
For a line passing through $P(x_1, y_1, z_1)$ and $Q(x_2, y_2, z_2)$:
The projection of $\overrightarrow{PQ}$ on any line with DCs $(l',m',n')$ is:
$$\text{Projection} = l'(x_2-x_1) + m'(y_2-y_1) + n'(z_2-z_1)$$Special case — projection on coordinate axes:
- On $x$-axis: $x_2-x_1$
- On $y$-axis: $y_2-y_1$
- On $z$-axis: $z_2-z_1$
Solved Examples
Find the direction cosines of a line whose direction ratios are $2, -3, 6$.
$a=2,\ b=-3,\ c=6$
$$\sqrt{a^2+b^2+c^2} = \sqrt{4+9+36} = \sqrt{49} = 7$$ $$\boxed{l = \frac{2}{7},\quad m = \frac{-3}{7},\quad n = \frac{6}{7}}$$Check: $\dfrac{4}{49}+\dfrac{9}{49}+\dfrac{36}{49} = \dfrac{49}{49} = 1$ ✓
Find the direction cosines of the line joining $A(2,-1,3)$ and $B(4,3,1)$.
DRs $= (4-2,\ 3+1,\ 1-3) = (2,4,-2)$
$$|AB| = \sqrt{4+16+4} = \sqrt{24} = 2\sqrt{6}$$ $$l = \frac{2}{2\sqrt{6}} = \frac{1}{\sqrt{6}},\quad m = \frac{4}{2\sqrt{6}} = \frac{2}{\sqrt{6}},\quad n = \frac{-2}{2\sqrt{6}} = \frac{-1}{\sqrt{6}}$$If a line makes angles $\alpha$, $\beta$, $\gamma$ with the coordinate axes, find the value of $\cos 2\alpha + \cos 2\beta + \cos 2\gamma$.
Using $\cos 2\theta = 2\cos^2\theta - 1$:
$$\cos 2\alpha + \cos 2\beta + \cos 2\gamma = 2(\cos^2\!\alpha + \cos^2\!\beta + \cos^2\!\gamma) - 3 = 2(1) - 3 = \boxed{-1}$$A line is equally inclined to all three coordinate axes. Find its direction cosines and the angle it makes with each axis.
Let the angle with each axis be $\alpha$. Then $l=m=n=\cos\alpha$.
$$l^2+m^2+n^2=1 \implies 3\cos^2\!\alpha=1 \implies \cos\alpha = \pm\frac{1}{\sqrt{3}}$$ $$\text{DCs}: \left(\frac{1}{\sqrt{3}},\frac{1}{\sqrt{3}},\frac{1}{\sqrt{3}}\right) \quad \text{or} \quad \left(-\frac{1}{\sqrt{3}},-\frac{1}{\sqrt{3}},-\frac{1}{\sqrt{3}}\right)$$ $$\alpha = \cos^{-1}\!\left(\frac{1}{\sqrt{3}}\right) \approx 54.74°$$If a line makes angles $90°$, $60°$, $30°$ with the positive $x$, $y$, $z$-axes, find its direction cosines. Verify $l^2+m^2+n^2=1$.
Board & JEE Tips
- Always verify your DCs by checking $l^2+m^2+n^2=1$ — easy 1-mark check
- When finding DRs from two points, order matters: use $Q-P$ consistently
- DRs are not unique — $(2,-3,6)$, $(4,-6,12)$, $(-2,3,-6)$ are all valid DRs for the same line
- Common 4-mark question: "Find DCs of line joining two given points"
- Another classic: "If a line makes equal angles with axes, find the DCs"
- Memorise: $\cos 2\alpha + \cos 2\beta + \cos 2\gamma = -1$ — appears in integer-type JEE questions
- $\sin^2\!\alpha + \sin^2\!\beta + \sin^2\!\gamma = 2$ — quick proof: $3 - (l^2+m^2+n^2+\text{extra})$
- Unit vector along direction $(l,m,n)$ is $l\hat{i}+m\hat{j}+n\hat{k}$ — connects DCs to vectors
- JEE often tests: "If $l,m,n$ are DCs, what is the unit vector along the line?"
- Writing DCs as $(a,b,c)$ instead of $\dfrac{(a,b,c)}{\sqrt{a^2+b^2+c^2}}$ — DRs ≠ DCs!
- Forgetting the $\pm$ sign when computing DCs from DRs
- Taking $\cos\alpha > 1$ — this is impossible; check your arithmetic
- Confusing $\sin^2+\sin^2+\sin^2 = 2$ with $= 1$ (that's for DCs, not $\sin^2$)