Skip to lesson content

Lesson 4 of 5

Three Dimensional Geometry · Lesson 4 of 5

Shortest Distance Between Lines

“Use common perpendiculars, projections, and vector products to measure separation between lines in space.”

Learning Objectives

• Distinguish intersecting, parallel, and skew lines in space. • Explain why the shortest connector of skew lines is perpendicular to both directions. • Derive and apply the scalar-triple-product formula and its Cartesian form. • Derive and apply the distance formula for parallel lines. • Check the line relationship before choosing a distance formula.

Why lines in space need another category

In a plane, distinct lines either intersect or are parallel. Space allows a third possibility: two lines may point in different directions and still never meet. A ceiling diagonal and a diagonal across a wall can behave this way. Their apparent crossing in a flat drawing need not be a shared point in the room.

Definition
Skew lines

Skew lines are lines in space that are neither parallel nor intersecting. They are noncoplanar, meaning there is no single plane containing both lines. This distinguishes them from parallel lines, which do lie in one plane.

A ceiling diagonal and a wall diagonal can be skewABCDUVWXVX: ceilingUB: wallDimensions:1 by 3 by 2The lines are not parallel and cannot meet, even when extended.
Skew directions in a room— The highlighted ceiling and wall diagonals are parts of lines that remain disjoint when extended.

In the diagram, , , , and . The line stays in the wall , while the ceiling line has only at . But is not on : on , occurs at , where . Thus the lines cannot meet, and their different directions show that they are not parallel.

Definition
Shortest distance between two lines

Join a point on one line to a point on the other. The shortest distance is the smallest possible length of such a joining segment. If the lines intersect, this minimum is zero at their common point.

For distinct parallel lines, a perpendicular from one line to the other gives the minimum. For skew lines, the shortest connector must be perpendicular to both directions: if it had a component along either line, sliding the endpoint on that line could shorten it. This connector is called their common perpendicular.

Project onto a common normal

Consider nonparallel lines and . Their direction vectors have a nonzero cross product. It points perpendicular to both lines, so it gives the direction of their common perpendicular.

Normalize that cross product to obtain a unit vector . Take anchors and with position vectors and . Their joining vector is . This vector generally travels partly along the line directions and partly across the gap.

Project any joining vector onto the common normalPQSTdSTl₁l₂PQ is perpendicular to both lines in space; the drawing is a projection.
A projection isolates the gap— Any component along either line has zero projection onto the common normal.

The signed component across the gap is . Moving or along its own line only adds a multiple of or to the connector. Both have dot product zero with , so this normal component does not change. Its absolute value is a lower bound for every connector length, and the common perpendicular attains that bound.

Shortest distance for nonparallel linesLaTeX
The numerator is the absolute scalar triple product: dot the anchor displacement with the cross product of the directions. Divide by the length of that cross product. The result is positive for skew lines and zero for intersecting lines.

There is also an area-and-volume interpretation. The cross-product magnitude is the area of a parallelogram formed by the two direction vectors. Adding the anchor displacement gives a parallelepiped whose volume is the absolute scalar triple product. Since volume equals base area times perpendicular height, their ratio is the gap . This is the same projection argument expressed geometrically.

Example — A simple skew pair

Problem
Find the shortest distance between the -axis and .

  1. 1.Use anchors and , with directions and . The cross product is , of length one.
  2. 2.The anchor displacement is , whose dot product with the cross product is . Therefore .
  3. 3.The segment from to is vertical and perpendicular to both lines. It realizes the calculated minimum. The directions are at right angles, yet the lines do not intersect.
Example — A scalar-triple-product calculation

Problem
Find the distance between and .

  1. 1.Read , , and .
  2. 2.Compute the cross product component by component: .
  3. 3.Its length is . The scalar triple product is .
  4. 4.Thus units. The nonzero cross product excludes parallelism, and the positive distance excludes intersection, so these lines are skew.

The Cartesian determinant form

When lines are supplied in symmetric Cartesian form, first identify the anchors and directions. The vector formula is still available. Expanding its scalar triple product as a determinant simply provides a coordinate version, with no new distance principle.

Let the anchors be and , and the directions be and . The determinant below is the dot product of the first row with the cross product of the other two rows. The denominator is the length of that cross product.

Cartesian shortest-distance formulaLaTeX
Apply this form only when the directions are nonparallel. Swapping the line labels changes possible signs, but the outer absolute value preserves the nonnegative distance.
A joining vector is a difference

The anchor connector is , not . The cross product belongs between the two direction vectors. Keeping these roles separate makes the projection formula easier to reconstruct and helps catch a wrong numerator.

Parallel lines need a separate formula

For parallel directions, , so the previous denominator vanishes. Choose one common nonzero direction vector for both lines instead. A connector between anchors forms a parallelogram with , and its height is the perpendicular separation of the lines.

Write the lines as and . If the angle between and is , then the perpendicular gap is . The cross-product magnitude equals this expression multiplied by . Dividing by that nonzero length gives the distance.

Parallel lines: separate sideways travel from perpendicular distanceSPTd = TPSTdirection bCross-product area = base length × perpendicular separation.
A perpendicular between parallel lines— Sliding along the line changes the sloping connector but not the perpendicular height.
Distance between parallel linesLaTeX
Use the magnitude of the whole cross product, not one component. The formula also gives zero when the two equations describe the same line.
Example — Parallel lines with a shared direction vector

Problem
Find the distance between and .

  1. 1.The identical direction vectors show parallelism. The anchor displacement is and the common direction is .
  2. 2.Compute . Its length is .
  3. 3.The common direction has length . Therefore units.
Example — Parallel directions need not look identical

Problem
Find the distance between and .

  1. 1.The second direction is times the first. Replace it by the common direction ; this changes only the parameterization.
  2. 2.The anchor displacement is , and .
  3. 3.Its length is , while , so the distance is . The anchor displacement is already perpendicular to the common direction in this example.

Choose and check the method

Inspect the directions before calculating distance. If they are parallel, use the parallel formula and allow for coincident lines. Otherwise use the scalar-triple-product formula. A zero result in this nonparallel case identifies intersecting lines, while a positive result identifies skew lines.

Example — A zero distance with nonparallel directions

Problem
Compare and .

  1. 1.The cross product of the directions is , so the lines are not parallel.
  2. 2.The anchor displacement is , whose dot product with this cross product is zero. The nonparallel distance formula gives .
  3. 3.Indeed, at and both equations give . The zero distance has a direct geometric explanation: the lines intersect.

Check your understanding

Treat classification as part of the solution, not as an optional label at the end. These questions focus on the geometric meaning of the formulas and on the cases in which a formula can be used.

Quiz

Quick check

Which description defines skew lines?

Quick check

Which direction is perpendicular to both nonparallel directions and ?

Quick check

Why can the skew-line formula not be applied directly to parallel lines?

Quick check

Find the distance between the -axis and .

Quick check

Two nonparallel lines have . What follows?

Quick check

Find the distance between and .

Quick check

Why does choosing a different anchor on either skew line preserve the distance calculation?

Practice Problems

Practice Problems
  1. Find the shortest distance between and .
  2. Find the shortest distance between and .
  3. Find the shortest distance between and .
  4. Find the shortest distance between and .
  5. Find the distance between the parallel lines and .
  6. Find the shortest distance between and .
  7. Classify and find the distance between and .
  8. Explain why a zero cross product of direction vectors does not by itself imply zero distance.
  9. Find the line angle and shortest distance for and .
  10. Explain why replacing by leaves the nonparallel distance formula unchanged.

The anchor displacement is and the cross product is . The absolute dot product is and the cross-product length is , so .

Key Takeaways

Key Takeaways

• Skew lines are nonparallel, nonintersecting, and noncoplanar. • A common perpendicular realizes their minimum separation. • For nonparallel lines, project the anchor difference onto the cross-product normal. • For parallel lines, divide the cross-product area made with a common direction by that direction length. • Check denominators and use absolute values or vector magnitudes so distance is nonnegative.