Property — Distance between two skew lines

Given r1:S=A+v1tr_1:\vec S=\vec A+\vec v_1 t and r2:S=B+v2sr_2:\vec S=\vec B+\vec v_2 s skew: d(r1,r2)=AB(v1×v2)v1×v2\boxed{\,d(r_1,r_2) = \dfrac{|\vec{AB}\cdot(\vec v_1\times\vec v_2)|}{|\vec v_1\times\vec v_2|}\,}

Proof — Interpretation via the parallelepiped

The three vectors AB,v1,v2\vec{AB},\vec v_1,\vec v_2 determine a parallelepiped. Its volume equals AB(v1×v2)|\vec{AB}\cdot(\vec v_1\times\vec v_2)| (scalar triple product) and its base area v1×v2|\vec v_1\times\vec v_2|. The height is therefore volume divided by base area, that is the distance between the two parallel planes containing the two lines — namely the distance between the lines themselves. ∎

Warning — Common mistake: confusing it with the point–plane distance

The alternative method “parametrise a point on one line and compute the point–plane distance” works only for the line–parallel plane distance, not for two generic skew lines. The formula with the scalar triple product is the correct and universal one.

Example

Let r1:(1;1;4)+t(2;3;1)r_1:(1;-1;4)+t(2;3;-1) and r2:(5;4;2)+s(4;7;3)r_2:(5;-4;-2)+s(-4;7;3). Then AB=(4;3;6)\vec{AB}=(4;-3;-6) and v1×v2=(33(1)7,  (1)(4)23,  273(4))=(16;  2;  26).\vec v_1\times\vec v_2 = \bigl(3\cdot 3-(-1)\cdot 7,\; (-1)(-4)-2\cdot 3,\; 2\cdot 7-3\cdot(-4)\bigr) = (16;\; -2;\; 26). Hence v1×v2=256+4+676=93630,6|\vec v_1\times\vec v_2| = \sqrt{256+4+676}=\sqrt{936}\approx 30{,}6 and AB(v1×v2)=64+6156=86\vec{AB}\cdot(\vec v_1\times\vec v_2) = 64+6-156=-86, whence d=8630,62,81.d = \frac{86}{30{,}6}\approx 2{,}81.

Topics: Analytic geometry in space
Concepts: Skew lines distance · Scalar triple product · Cross product · Line · Skew lines
Skills: Proving · Analytic geometry · Using formulae