Thank you for reporting, we will resolve it shortly
Q.
The direction cosines of a line passing through two points $P\left(x_1, y_1, z_1\right)$ and $Q\left(x_2, y_2, z_2\right)$ are
Three Dimensional Geometry
Solution:
Since, one and only one line passes through two given points, we can determine the direction cosines of a line passing through the given points $P\left(x_1, y_1, z_1\right)$ and $Q\left(x_2, y_2, z_2\right)$ as follows
Let $l, m$ and $n$ be the direction cosines of the line $P Q$ and let it makes angles $\alpha, \beta$ and $\gamma$ with the $X, Y$ and Z-axes, respectively.
Draw perpendiculars from $P$ and $Q$ to $x y$-plane to meet at $R$ and $S$. Draw a perpendicular from $P$ to $Q S$ to meet at $N$. Now, in right angled $\triangle P N Q, \angle P Q N=\gamma$ from (figure).
Therefore, $ \cos \gamma=\frac{N Q}{P Q}=\frac{z_2-z_1}{P Q}$
Similarly, $ \cos \alpha=\frac{x_2-x_1}{P Q}$
and $ \cos \beta=\frac{y_2-y_1}{P Q}$
Hence, the direction cosines of the line segment joining the points $P\left(x_1, y_1, z_1\right)$ and $Q\left(x_2, y_2, z_2\right)$ are
$\frac{x_2-x_1}{P Q}, \frac{y_2-y_1}{P Q}, \frac{z_2-z_1}{P Q}$
$\text { where, } P Q=\sqrt{\frac{x_2-x_1}{P Q}, \frac{y_2-y_1}{P Q}, \frac{z_2-z_1}{P Q}}$