Distance of two parametrized lines

linear algebraparametrizationplane-geometry

Consider the four points $A = (2, 4, 0), B = (3, 1, 1), C = (1, 1, 3), D = (0, 5, 1)$. Find the distance between the lines $(AB)$ and $(CD)$, i.e. the distance between the closest points on these two lines, by using this method:

Find parametric equations of the lines $(AB)$ and $(CD)$, and find the times at which the line segment connecting a point $P_1$ on $(AB)$ to a point $P_2$ on $(CD)$ is perpendicular to both lines. The length of this segment is then the distance between the lines.

The parametric equations of both lines are:

$$x = t+2$$
$$x = -3t+4$$
$$x = t$$

and

$$x = -t_1+ 1$$
$$x = 4t_1+1$$
$$x = -2t_1+3$$

the line segment connecting them would be:

$$ABCD = (-2,7,-3)$$

how can I find when the segment is perpendicular to both lines?

note $$AB \times CD = (2,1,1)$$

Best Answer

Hint: we can find component forms of both lines. Hence, smallest distance between two lines given in component form is: $$d=\frac{\pm\begin{vmatrix} x_1-x_2 & y_1-y_2 & z_1-z_2\\ l_1 & m_1 & n_1\\ l_2 & m_2 & n_2 \end{vmatrix}}{\sqrt{\begin{vmatrix} l_1 & m_1 \\ l_2 & m_2 \end{vmatrix}^2+\begin{vmatrix} m_1 & n_1 \\ m_2 & n_2 \end{vmatrix}^2+\begin{vmatrix} n_1 & l_1 \\ n_2 & l_2 \end{vmatrix}^2}}.$$

If the determinant in the numerator is equal to zero, the lines intersect each other.