Direction Cosines And Direction Ratios


I. Introduction
We can start with a brief recap with our knowledge of lines in a $2D$ plane.
Let us look at the following diagram of a straight line in the $XY$ plane.

Let's say the line, $L$, makes an angle of $\alpha$ with the $X$-axis and $\beta$ with the $Y$-axis, as shown in the diagram.
We can consider any segment, $l$,  of $L$, and draw the rectangle $PQRS$, where $l$ is the diagonal of the rectangle.
Therefore,
$\cos \alpha = \dfrac{PQ}{l}$ and $\cos \beta = \dfrac{SP}{l}$

$\therefore \cos^2 \alpha + \cos^2 \beta = \left( \dfrac{PQ}{l} \right)^2 + \left( \dfrac{SP}{l} \right)^2$

$\Rightarrow \cos^2 \alpha + \cos^2 \beta = \dfrac{PQ^2 + SP^2}{l^2}$
  
$\Rightarrow \cos^2 \alpha + \cos^2 \beta = \dfrac{l^2}{l^2} = 1$

-----------book page break-----------
II. Direction Cosine
The widget below shows a straight line in three dimensions, passing through the origin. Try moving the endpoint of the line around using the yellow dot $(\textcolor{yellow}{\bullet})$, $P$, and see how the angle with the three axes, and their corresponding cosine value changes.
--------- Reference to widget: 4caef3fd-04c4-418a-911e-e55d149673cc ---------

Let the coordinates of $P$ be $(x, y, z)$.
Therefore, $\cos \alpha = \dfrac{x}{OP}$, $\cos \beta = \dfrac{y}{OP}$ and $\cos \gamma = \dfrac{z}{OP}$
$OP$ is the diagonal of the cuboid shown in the widget. Therefore, $OP^2 = x^2 + y^2 + z^2$

Therefore,
$\cos^2 \alpha + \cos^2 \beta  + \cos^2 \gamma = \dfrac{x^2}{OP^2} + \dfrac{y^2}{OP^2} + \dfrac{z^2}{OP^2}$

-----------book page break-----------
$= \dfrac{x^2 + y^2 + z^2}{OP^2} = \dfrac{OP^2}{OP^2} = 1$

III. Equation Of A Line
The widget above showed a line passing through the origin. Here we can consider any random line, passing through $M (x_1, y_1, z_1)$, and having direction cosines of $\cos \alpha$, $\cos \beta$ and $\cos \gamma$ respectively.
If we choose any other point, $P (x, y, z)$, on this line, and draw a cuboid with $MP$ as the diagonal then $MP = \sqrt{(x - x_1)^2 + (y - y_1)^2 + (z - z_1)^2}$, and the direction cosines will be:
$\cos \alpha = \dfrac{x - x_1}{MP} \Rightarrow MP = \dfrac{x - x_1}{\cos \alpha}$,

$\cos \beta = \dfrac{y - y_1}{MP} \Rightarrow MP = \dfrac{y - y_1}{\cos \beta}$,

$\cos \gamma = \dfrac{z - z_1}{MP} \Rightarrow MP = \dfrac{z - z_1}{\cos \gamma}$

Combining the three equations above, we get:
$MP = \dfrac{x - x_1}{\cos \alpha} = \dfrac{y - y_1}{\cos \beta} = \dfrac{z - z_1}{\cos \gamma}$

If we choose any other point $P'$ on the line, the diagonal distance $MP'$ will change, but the relationship 

$\dfrac{x - x_1}{\cos \alpha} = \dfrac{y - y_1}{\cos \beta} = \dfrac{z - z_1}{\cos \gamma}$
will still be valid.

-----------book page break-----------
Thus, the set of equations,
$\dfrac{x - x_1}{\cos \alpha} = \dfrac{y - y_1}{\cos \beta} = \dfrac{z - z_1}{\cos \gamma}$
represent the line passing through the point $(x_1, y_1, z_1)$ and having direction cosines of $\cos \alpha$, $\cos \beta$ and $\cos \gamma$ with the $X$, $Y$ and $Z$ axes respectively.

Conventionally, the direction angles of a line with the positive $x$, $y$ and $z$ axes are denoted using $\alpha$, $\beta$ and $\gamma$ respectively, and the three direction cosines, $\cos \alpha$, $\cos \beta$ and $\cos \gamma$ are represented using $l$, $m$ and $n$ respectively. 



Introduction To 3D Space -