LearnWave
Learn it. Master it.

Three Dimensional Geometry

Shortest distance between lines

Find shortest distances between lines.

In a flat plane, two lines either meet or are parallel. In space there is a third possibility: lines that never meet and are not parallel, like a road and a flyover crossing it at an angle. These are skew lines: they do not lie in one plane.

The shortest distance between two lines is the length of the segment that is perpendicular to both.

For r = a₁ + λb₁ and r = a₂ + μb₂:

d = |(b₁ × b₂) · (a₂ – a₁)| / |b₁ × b₂|

In words: b₁ × b₂ is perpendicular to both lines. Take the vector joining a point on one line to a point on the other, a₂ – a₁, and find its projection on b₁ × b₂.

Example: line 1 is the x-axis, r = λî (a₁ = 0, b₁ = î). Line 2 passes through (0, 1, 0) along k̂ (a₂ = ĵ, b₂ = k̂). b₁ × b₂ = î × k̂ = –ĵ, with length 1. (a₂ – a₁) · (–ĵ) = –1. So d = 1, which matches the picture: the lines are one unit apart in the y-direction.

If d = 0, the lines intersect.

Parallel lines r = a₁ + λb and r = a₂ + μb have b₁ × b₂ = 0, so the formula above fails. Use instead: d = |b × (a₂ – a₁)| / |b|. Example: lines along î through the origin and through (0, 3, 4): î × (3ĵ + 4k̂) = 3k̂ – 4ĵ, length 5, so d = 5.

From Cartesian form, read a₁ from the point and b₁ from the direction ratios first, then use the formula.

d = |(b₁ × b₂)·(a₂ – a₁)|/|b₁ × b₂|.
The shortest distance is perpendicular to both lines.

Practise this lesson

Questions that get harder as you improve, a Tutor that helps without giving the answer away, and progress you can see. Free for every learner.

No account, no email address. Opens the real product.