[Math] Distance between two skew lines in 3D space

geometrylinear algebra

I know this question exists but the answer is very vague, and I'm hoping someone could provide a more complete example (rather than just providing a formula that is difficult to use)

I have two lines:

1: $\begin{bmatrix} 1 \\ 0 \\ -1 \end{bmatrix} + t\begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix}$

2: $\begin{bmatrix} -1 \\ 1 \\ 0 \end{bmatrix} + s\begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix}$

How can I determine the shortest distance between them (without calculus, which I haven't learned yet)?

Best Answer

The shortest line joining line 1 and line 2 is perpendicular to each of them, so has direction $(1,2,3) \times (0,0,1) = (2,-1,0)$.

Make this a unit vector, $\mathbf{u} = (\frac{2}{\sqrt 5},-\frac{1}{\sqrt 5}, 0)$.

Take any point $\mathbf{p}_1$ on line 1, and any point $\mathbf{p}_2$ on line 2; in this case, the obvious choices are $\mathbf{p}_1 = (1,0,-1)$ and $\mathbf{p}_2 = (-1,1,0)$. Let $\mathbf{v} = \mathbf{p}_1-\mathbf{p}_2 = (2,-1,-1)$.

Now the distance between the lines is just $|\mathbf{u}.\mathbf{v}| = \sqrt 5$.

Related Question