In a plane, two distinct lines either intersect or are parallel. In space there is a third possibility: skew lines — lines that are neither parallel nor intersecting. They lie in different planes, like a road and an overhead flyover crossing above it.
For intersecting lines the shortest distance is 0; for the other cases there is a unique common perpendicular — the segment PQ meeting both lines at right angles — and its length is the shortest distance.
The skew-lines formula
For r=a1+λb1 and r=a2+μb2:
d=b1×b2(b1×b2)⋅(a2−a1)
Why it works: the common perpendicular is perpendicular to both directions, so it points along n^=b1×b2b1×b2. The distance is the projection of the joining vector a2−a1 on this unit normal — a scalar triple product over a cross-product magnitude.
Key Point (the coplanarity test hiding inside): the numerator (b1×b2)⋅(a2−a1) is the scalar triple product [b1b2a2−a1]. It vanishes exactly when the two (non-parallel) lines are coplanar, i.e. intersecting. So the same computation answers both "how far apart?" and "do they meet?" — d=0 means they intersect.
Parallel Lines, and the Exam Workflow
Parallel-lines formula
Parallel lines share a direction b, so b1×b2=0 and the skew formula breaks down. Instead, drop a perpendicular from any point of one line to the other:
d=bb×(a2−a1)
(the cross product's magnitude is ∣a2−a1∣∣b∣sinθ, and dividing by ∣b∣ leaves exactly the perpendicular offset).
The workflow, every time
Extracta1,b1,a2,b2 — converting Cartesian or parametric forms to standard form first.
Check parallelism: are b1,b2 proportional? Yes → parallel formula. No → skew formula.
Skew route: compute b1×b2 (determinant), dot with a2−a1, divide by the cross's magnitude, absolute value on top.
Interpretd=0: the lines intersect.
Key Point (three traps): (1) the numerator's modulus — a negative triple product just means the normal points the other way; (2) subtracting the anchor points in a consistent order (a2−a1 throughout — flipping only changes the sign the modulus removes anyway, but mixing coordinates mid-computation is fatal); (3) a line given parametrically like r=(1−t)i^+(t−2)j^+(3−2t)k^ must be regrouped as a+tb — here a=(1,−2,3) and b=(−1,1,−2) — before anything else.
Solved Examples
Example 1: The standard skew computation
Find the shortest distance between r=i^+j^+λ(2i^−j^+k^) and r=2i^+j^−k^+μ(3i^−5j^+2k^).
Solution:
Cross the directions:b1×b2=i^23j^−1−5k^12=3i^−j^−7k^, magnitude 9+1+49=59.
Joining vector:a2−a1=i^−k^.
Triple product:(3)(1)+(−1)(0)+(−7)(−1)=10.
Answer:d=5910.
Example 2: Parallel lines
Find the distance between r=i^+2j^−4k^+λ(2i^+3j^+6k^) and r=3i^+3j^−5k^+μ(2i^+3j^+6k^).
Solution:
Same directionb=(2,3,6), ∣b∣=7 — use the parallel formula.