Academy
Formulas/maths/3d Geometry/Direction Cosines from Direction Ratios

Direction Cosines from Direction Ratios

If (a, b, c) are direction ratios of a line, the direction cosines are obtained by dividing by √(a²+b²+c²). Direction ratios are proportional to direction cosines but not normalized.
Derivation

Direction ratios (a,b,c)(a, b, c) of a line are any three numbers proportional to its direction cosines — i.e., l:m:n=a:b:cl:m:n = a:b:c.

So l=kal = ka, m=kbm = kb, n=kcn = kc for some scalar kk.

Using l2+m2+n2=1l^2+m^2+n^2 = 1:

k2(a2+b2+c2)=1    k=±1a2+b2+c2k^2(a^2+b^2+c^2) = 1 \implies k = \pm\frac{1}{\sqrt{a^2+b^2+c^2}}

Therefore:

l=aa2+b2+c2,m=ba2+b2+c2,n=ca2+b2+c2l = \frac{a}{\sqrt{a^2+b^2+c^2}}, \quad m = \frac{b}{\sqrt{a^2+b^2+c^2}}, \quad n = \frac{c}{\sqrt{a^2+b^2+c^2}}

(or the negatives of all three — for the opposite direction).

Key difference: Direction cosines are unique (up to an overall sign flip); direction ratios are not unique — any scalar multiple (ka,kb,kc)(ka, kb, kc) represents the same line direction.

Example: Line joining A(1,2,3)A(1,2,3) to B(4,6,3)B(4,6,3): DRs are (3,4,0)(3, 4, 0). DCs: l=3/5l = 3/5, m=4/5m = 4/5, n=0n = 0. (9+16+0=5\sqrt{9+16+0} = 5.) The line is parallel to the xy-plane since n=0n = 0.