Grade by Grade
C. Geometry and Algebra of Vectors · Lines and Planes

Distances Between Skew Lines, and Between a Line and a Plane

C4.7About 70 minutes
Learning goals
  • I can find the distance between two skew lines using a projection onto m₁ × m₂.
  • I can find the closest points on two skew lines (the common perpendicular).
  • I can find the distance between a line and a plane parallel to it.
  • I can interpret a distance of zero as an intersection.

Words to know

common perpendicular
The segment joining two skew lines that is perpendicular to both; its length is the distance between the lines.
distance between skew lines
d = |P₁P₂ · (m₁ × m₂)| / |m₁ × m₂|.
parallelepiped
A solid with six parallelogram faces; its volume is |a · (b × c)|.

How close do two flight paths come?

Two aircraft cross over Southern Ontario on straight routes at different altitudes. Seen on a map, their routes cross; in three dimensions, the paths are skew lines. How close do the paths come? That is a distance between two lines, and it is the last big calculation of this unit.

You already know how to tell that lines are skew (the lesson Intersections of Lines in Three-Space: Intersecting, Parallel and Skew). Now you will measure how far apart they are, find the two closest points, and also find the distance from a line to a plane parallel to it.

The distance between skew lines

Let L₁ pass through P₁ with direction m₁, and L₂ pass through P₂ with direction m₂, and suppose they are skew.

  • The vector n = m₁ × m₂ is perpendicular to both lines.
  • The plane through L₁ with normal n and the plane through L₂ with normal n are parallel. Each line lies in its own plane.
  • So the distance between the lines is the distance between those parallel planes, which is the scalar projection of P₁P₂ onto n:

d = |P₁P₂ · (m₁ × m₂)| / |m₁ × m₂|.

If this gives 0 (and the lines are not parallel), the lines intersect. For parallel lines, m₁ × m₂ = 0, so use the point-to-line formula from the previous lesson instead.

L₁L₂dn = m₁ × m₂
Skew lines L₁ and L₂ lie in two parallel planes, both with normal n = m₁ × m₂. The shortest segment joining the lines (dashed) is perpendicular to both, and its length d is the distance between the planes.
L₁ planeL₂ planenP₁P₂P₁P₂d = |P₁P₂ · n| / |n|
Pick any point P₁ on L₁ and P₂ on L₂. Only the part of P₁P₂ along n counts toward the gap between the parallel planes, so the distance is the scalar projection of P₁P₂ onto n.

The two closest points

The segment joining the closest points P (on L₁) and Q (on L₂) is perpendicular to both lines. Write P = r₁ + tm₁ and Q = r₂ + sm₂. Then solve

PQ · m₁ = 0 and PQ · m₂ = 0

for t and s. This gives the endpoints of the common perpendicular, and |PQ| is the distance (a good check on the formula).

A line parallel to a plane

If m · n = 0, the line is parallel to the plane, and every point of the line is the same distance from the plane. Pick any point of the line and use d = |Ax₀ + By₀ + Cz₀ + D| / |n|.

Worked example

Example 1: Distance between skew lines

Find the distance between L₁: r = [1, −1, 2] + t[2, 1, 0] and L₂: r = [0, 3, 1] + s[1, −1, 1] (shown to be skew in an earlier lesson).

  1. n = [2, 1, 0] × [1, −1, 1] = [(1)(1) − (0)(−1), (0)(1) − (2)(1), (2)(−1) − (1)(1)] = [1, −2, −3]. |n| = √14.
  2. P₁P₂ = [0 − 1, 3 − (−1), 1 − 2] = [−1, 4, −1].
  3. P₁P₂ · n = −1 − 8 + 3 = −6.
  4. d = |−6| / √14 = 6/√14 = 3√14/7.

The lines are 3√14/7 ≈ 1.60 units apart.

Worked example

Example 2: The closest points

For the lines of Example 1, find the closest points P on L₁ and Q on L₂.

  1. P = (1 + 2t, −1 + t, 2) and Q = (s, 3 − s, 1 + s). PQ = [s − 1 − 2t, 4 − s − t, s − 1].
  2. PQ · [2, 1, 0] = 2s − 2 − 4t + 4 − s − t = s − 5t + 2 = 0.
  3. PQ · [1, −1, 1] = (s − 1 − 2t) − (4 − s − t) + (s − 1) = 3s − t − 6 = 0.
  4. From the first, s = 5t − 2. Then 15t − 6 − t − 6 = 0, so t = 6/7 and s = 16/7.
  5. P = (19/7, −1/7, 2) and Q = (16/7, 5/7, 23/7). PQ = [−3/7, 6/7, 9/7] = (3/7)[−1, 2, 3], parallel to n ✓. |PQ| = (3/7)√14 ✓.

P = (19/7, −1/7, 2) and Q = (16/7, 5/7, 23/7); the gap between them is 3√14/7, as in Example 1.

Worked example

Example 3: Line parallel to a plane

Find the distance between the line r = [1, 0, 2] + t[2, 1, −1] and the plane x − y + z = 5.

  1. Check parallel: [2, 1, −1] · [1, −1, 1] = 2 − 1 − 1 = 0 ✓.
  2. Use the point (1, 0, 2): d = |1 − 0 + 2 − 5| / √3 = 2/√3.

d = 2/√3 ≈ 1.15.

Worked example

Example 4: Flight paths

Two aircraft fly straight, level routes: A along r = [0, 0, 9] + t[4, 3, 0] and B along r = [10, 0, 10] + s[0, 5, 0], in kilometres. How close do the paths come?

  1. n = [4, 3, 0] × [0, 5, 0] = [(3)(0) − (0)(5), (0)(0) − (4)(0), (4)(5) − (3)(0)] = [0, 0, 20]. It points straight up, as it should for two level routes.
  2. P₁P₂ = [10, 0, 1]. P₁P₂ · n = 20. |n| = 20.
  3. d = 20/20 = 1.

The paths come within 1 km of each other: exactly the difference in altitude, 10 km − 9 km. (Whether the aircraft themselves come that close also depends on when each one reaches the crossing point.)

Just for fun

Skew lines make the safest flight paths in the sky: no matter how far the planes fly, the paths never cross. Air traffic controllers would love every route to be this antisocial.

Hands-on activity

Two chopsticks

You need: two chopsticks (or pencils), two lumps of modelling clay (or two small boxes of different heights), a ruler, and a table.

  1. Fix one chopstick flat on the table, held by clay. Rest the other on a box so it is level, about 6 cm above the table, pointing in a different direction so that, seen from above, the two chopsticks cross.
  2. From directly above, they seem to cross. From the side, they clearly do not meet: they are skew.
  3. Slide the ruler vertically between them to find the smallest gap. Where is it? (Right where they seem to cross from above.)
  4. Now tilt the upper chopstick slightly by raising one end. Find the smallest gap again. Is it still exactly vertical, and still at the "crossing"?

What to look for: when both chopsticks are level, the shortest gap is vertical and equals the height difference (like Example 4). When one is tilted, the shortest gap is no longer straight up: it is along m₁ × m₂, perpendicular to both chopsticks.

Your turn

1

Find the distance between the skew lines r = t[1, 0, 0] and r = [0, 0, 5] + s[0, 1, 0].

2

Find the distance between r = [1, 2, 0] + t[1, 0, 1] and r = [0, 0, 1] + s[0, 1, 1].

3

Use the distance formula to show that r = [1, 1, 0] + t[1, −1, 1] and r = [0, −1, 1] + s[2, 1, 0] intersect.

4

Find the distance between the line r = [0, 0, 3] + t[1, 1, 0] and the plane z = 0.

5

Find the distance between r = [2, 1, 1] + t[1, 1, 1] and the plane x − 2y + z = 9.

6

Can the formula |P₁P₂ · (m₁ × m₂)| / |m₁ × m₂| be used for parallel lines? Explain.

7

Two aircraft fly level routes that cross on a map, one at 10.5 km altitude and one at 11.3 km. How close do the paths come?

More practice: warm-up

1

The common perpendicular to two skew lines is perpendicular to which lines?

2

Which vector gives the direction of the common perpendicular?

3

Two non-parallel lines give |P₁P₂ · (m₁ × m₂)| = 0. What does that mean?

4

Find the distance between the x-axis and the line x = 0, z = 2 (parallel to the y-axis).

5

Find the distance between the z-axis and the line x = 3, y = 0 (parallel to the z-axis).

More practice: on your own

1

Find the distance between r = [1, 0, −1] + t[1, 2, 0] and r = [0, 1, 3] + s[0, 1, 1].

2

Find the closest points of the x-axis and the line r = [0, 2, 3] + s[1, 1, 0], and the distance.

3

Find the distance between the line r = [1, −1, 2] + t[3, 0, 1] and the plane x + 2y − 3z = 4.

4

Two straight pipes run along r = [0, 0, 3] + t[1, 0, 0] and r = [2, −1, 0] + s[0, 1, 1] (metres). How long is the shortest straight connector between them?

5

Explain in words why d = |P₁P₂ · n| / |n| with n = m₁ × m₂ gives the distance between skew lines.

Challenge

1

Find the endpoints of the common perpendicular of L₁: r = [1, 0, 0] + t[1, 1, 0] and L₂: r = [0, 0, 2] + s[0, 1, 1], and the distance.

2

Explain the skew-line distance formula as "volume ÷ base area".

3

For which k do the lines r = [1, 2, k] + t[1, 0, 1] and r = [0, 1, 0] + s[1, 1, 0] intersect? Find the distance between them when k = 3.

Check your understanding

Quiz

1.

Which formula gives the distance between skew lines through P₁ and P₂ with directions m₁ and m₂?

2.

What is the distance between the x-axis and the line r = [0, 0, 5] + s[0, 1, 0]?

3.

For two non-parallel lines, |P₁P₂ · (m₁ × m₂)| = 0. The lines:

4.

Why can't the skew-line formula be used for two parallel lines?

5.

What is the distance between the line r = [0, 0, 3] + t[1, 1, 0] and the plane z = 0?

6.

The common perpendicular to two skew lines has direction:

For parents and teachers

Big idea (C4.7): two skew lines sit in two parallel planes with normal m₁ × m₂. The distance between the lines is the distance between those planes: project any joining vector onto the normal. Setting PQ perpendicular to both directions finds the two closest points.

How to help: The chopstick model shows the idea: from above, skew lines seem to cross; from the side, there is a gap. Ask your teen to estimate the gap before calculating.

Common difficulties:

  • Using the formula for parallel lines (division by zero). Check the directions first.
  • Mixing up the order of operations: it is the dot product of P₁P₂ with the cross product, then divided by the length of the cross product.
  • Forgetting the absolute value.
  • In the closest-points method, using the same parameter for both lines, or dotting with only one direction vector.