- Practice
- About 18 min
- 5 practice questions
Shortest distance between two lines: the standard cases
Classify a pair of lines as intersecting, parallel or skew, and find the shortest distance with the right formula in vector or Cartesian form, including lines that turn out to be the same.
If something looks wrong, please tell us.
Two lines in space either meet, are parallel, or are skew: not parallel and never meeting. The shortest distance between them is zero, the gap between the parallel lines, or the length of the common perpendicular. Exams test whether you choose the right case quickly and apply its formula without slips.
Classify first
| Directions | Triple product (a₂ − a₁) · (b₁ × b₂) | The lines are | Shortest distance |
|---|---|---|---|
| Proportional | not needed | parallel (or the same line) | |b × (a₂ − a₁)|/|b| |
| Not proportional | zero | intersecting | 0 |
| Not proportional | non-zero | skew | |(a₂ − a₁) · (b₁ × b₂)|/|b₁ × b₂| |
Skew lines: d = |(a₂ − a₁) · (b₁ × b₂)| / |b₁ × b₂|. Parallel lines with direction b: d = |b × (a₂ − a₁)| / |b|. Here a₁ and a₂ are points on the lines and b₁, b₂ their directions.
In Cartesian form, a₁ and a₂ are the points read from the numerators and b₁, b₂ are the denominators. The numerator of the skew formula is the absolute value of the determinant whose rows are (x₂ − x₁, y₂ − y₁, z₂ − z₁), (a₁, b₁, c₁) and (a₂, b₂, c₂).
Worked example 1: skew lines
Find the shortest distance between (x − 1)/1 = (y + 1)/2 = z/2 and (x − 2)/2 = (y − 1)/(−2) = (z + 1)/1. Here a₁ = (1, −1, 0), b₁ = (1, 2, 2), a₂ = (2, 1, −1) and b₂ = (2, −2, 1). The cross product is b₁ × b₂ = (2·1 − 2·(−2), 2·2 − 1·1, 1·(−2) − 2·2) = (6, 3, −6), of length 9. The joining vector is a₂ − a₁ = (1, 2, −1), and its dot product with (6, 3, −6) is 6 + 6 + 6 = 18. So d = 18/9 = 2. Speed tip: (6, 3, −6) = 3(2, 1, −2), and using (2, 1, −2), of length 3, in both the numerator and the denominator gives 6/3 = 2 again.
Worked example 2: parallel lines with a scaled direction
Find the distance between r = (î + ĵ − k̂) + λ(î − 2ĵ + 2k̂) and r = (3î + 2ĵ + 2k̂) + μ(−2î + 4ĵ − 4k̂). The second direction is −2 times the first, so the lines are parallel and the skew formula would divide by zero. Use b = (1, −2, 2), with |b| = 3, and a₂ − a₁ = (2, 1, 3). Then b × (a₂ − a₁) = ((−2)·3 − 2·1, 2·2 − 1·3, 1·1 − (−2)·2) = (−8, 1, 5), of length √90 = 3√10, so d = √10. The projection route agrees: |a₂ − a₁|² = 14, (a₂ − a₁) · b = 2 − 2 + 6 = 6, the projection is 6/3 = 2, and d² = 14 − 4 = 10.
Worked example 3: lines that meet
Find the shortest distance between (x − 1)/1 = (y − 1)/2 = z/1 and (x − 3)/1 = (y − 2)/(−1) = (z − 2)/1. Here b₁ × b₂ = (2·1 − 1·(−1), 1·1 − 1·1, 1·(−1) − 2·1) = (3, 0, −3) and a₂ − a₁ = (2, 1, 2). The triple product is 6 + 0 − 6 = 0, so the lines intersect and the shortest distance is 0. To find the point, equate the general points (1 + λ, 1 + 2λ, λ) and (3 + μ, 2 − μ, 2 + μ). The x- and z-coordinates both give λ − μ = 2, and the y-coordinates give 2λ + μ = 1. So λ = 1, μ = −1, and the lines meet at (2, 3, 1).
Traps to avoid
- Check for parallel directions before anything else; b₁ × b₂ = 0 makes the skew formula useless.
- Lines with proportional directions may be the same line: if a point of one satisfies the other, the distance is 0.
- Take the modulus of the triple product: a distance is never negative.
- A common factor taken out of b₁ × b₂ must be taken out of its length too.
Key takeaways. Classify the pair first: proportional directions mean the parallel formula, a zero triple product means the lines meet, and anything else is skew. Simplify the cross product before using it, and check parallel lines for being the same line.
Check your understanding
-
1. How are the lines (x − 1)/2 = (y + 1)/3 = z/4 and (x − 3)/4 = (y − 2)/6 = (z − 4)/8 related?
- They are the same line
- They are parallel and distinct
- They are skew
- They meet at exactly one point
Show answer
Answer: A. The directions (2, 3, 4) and (4, 6, 8) are proportional, so the lines are parallel or identical. The point (3, 2, 4) of the second line gives (3 − 1)/2 = 1, (2 + 1)/3 = 1 and 4/4 = 1 in the first, so it lies on the first line too. The lines coincide and the distance between them is 0.
-
2. What is the shortest distance between r = (î + ĵ) + λ(2î − ĵ + 2k̂) and r = (2î + 2ĵ + k̂) + μ(2î + 2ĵ − k̂)?
- 9
- 1
- 3
- 1/3
Show answer
Answer: B. b₁ × b₂ = ((−1)(−1) − 2·2, 2·2 − 2·(−1), 2·2 − (−1)·2) = (−3, 6, 6), of length 9. a₂ − a₁ = (1, 1, 1), and the dot product is −3 + 6 + 6 = 9. So d = 9/9 = 1.
-
3. What is the distance between the parallel lines (x − 1)/2 = (y − 2)/1 = (z + 1)/2 and (x − 4)/2 = (y − 5)/1 = (z + 1)/2?
- 3√2
- 9
- 1
- 3
Show answer
Answer: D. b = (2, 1, 2) with |b| = 3, and a₂ − a₁ = (3, 3, 0). Projection: (6 + 3 + 0)/3 = 3. Then d² = |a₂ − a₁|² − 3² = 18 − 9 = 9, so d = 3. 3√2 is just the length of a₂ − a₁, which is not perpendicular to the lines.
-
4. For what value of k do the lines x = y = z and (x − 1)/1 = (y − k)/2 = (z − 2)/3 intersect?
- −3/2
- 2/3
- 3
- 3/2
Show answer
Answer: D. The first line passes through O with direction (1, 1, 1). b₁ × b₂ = (1·3 − 1·2, 1·1 − 1·3, 1·2 − 1·1) = (1, −2, 1). The joining vector is (1, k, 2), and the triple product is 1 − 2k + 2 = 3 − 2k. Setting it to 0 gives k = 3/2; the lines then meet at (1/2, 1/2, 1/2).
-
5. What is the shortest distance between the x-axis and the line r = 3k̂ + μĵ?
- 0
- 3
- √3
- 9
Show answer
Answer: B. The x-axis is r = λî, so b₁ = (1, 0, 0) and b₂ = (0, 1, 0). b₁ × b₂ = (0, 0, 1), and a₂ − a₁ = (0, 0, 3). So d = |3|/1 = 3. Geometrically, the second line runs parallel to the y-axis at height 3 above the xy-plane, which contains the x-axis.
Sign in to keep track of the lessons you finish.