Pv13 - Distances between parallel or skew lines
The distance between two lines is the shortest gap between them, not the length between their displayed starting points. For parallel lines you reduce the problem to a point and a line. For skew lines you use the supplied formula and understand why its direction is perpendicular to both lines.
The shortest connector is perpendicular
Two rails have equations and . Their displayed starting points are units apart. Is that the gap between the rails?
Try different points. At , the first rail contains ; at , the second contains . The connector has length , so the starting-point distance cannot be the shortest. The connector is vertical and both rail directions are horizontal: it is perpendicular to both.
You already know
Parallel lines have proportional directions. Skew lines are non-parallel and have no common point. The shortest distance from a point to a line follows a perpendicular connector; a vector product of two non-parallel directions gives a direction perpendicular to both.
For a shortest connector between two lines, neither endpoint can slide a little along its line to make the connector shorter. Geometrically, it must meet each line at right angles. This explains the required direction without asking you to prove a distance formula.
Common perpendicular
A common perpendicular meets two lines and is perpendicular to both. For two skew lines, the segment of their common perpendicular between them is the shortest connector. For distinct parallel lines, there are infinitely many shortest perpendicular connectors, all with the same length.
The direction condition alone is not enough to locate the connector: its endpoints must actually lie on the two lines. In the rail example, the parameter substitutions establish this as well as the perpendicularity.
[DIAGRAM: asset_name: Shortest gap between skew rails; asset_slug: b029_common_perpendicular; caption: A connector perpendicular to both skew rails gives their shortest gap; description: A three-dimensional view shows blue line r=t(2,1,0) in z=0 and clay line r=(0,3,4)+s(1,2,0) in z=4. Sage segment QR joins Q=(-2,-1,0) to R=(-2,-1,4) and is labelled length 4. The displayed starting points A=(0,0,0) and B=(0,3,4) are joined by a thin dashed grey segment labelled length 5, not shortest. The two horizontal line directions are non-parallel, and QR is vertical, perpendicular to both.]

If the directions are and , their vector product provides the common perpendicular's direction when it is non-zero. This follows from the booklet's vector-product properties. Parallel directions instead give zero, so they need the point-to-line route in Part 2.
Key idea
A shortest connector between skew lines must be perpendicular to both directions. A connector between convenient starting points usually has extra movement along the lines.
The next check concerns direction only. The lines are stated to be skew, so there is a non-zero common-perpendicular direction.
Reducing parallel lines to a point and a line
Every point on one of two parallel lines has the same perpendicular distance from the other, so choose whichever point makes the arithmetic easiest.
If is on the first line, is on the second and is their common parallel direction, use the point-to-line method already learnt. A perpendicular-foot calculation is valid, or you can use the vector-product ratio below.
Distance between parallel lines
For parallel lines through and , in non-zero direction ,
Use either line's direction; it need not be a unit vector. Coincident lines give zero.
Not in the formula booklet: learn it.
This is exactly a point-to-line distance with as the point. The booklet supplies the vector-product operation, but not this particular distance ratio.
Worked example 1: the displayed points are not the nearest pair
Question. Determine the distance between
Plan. Confirm parallel directions, form a connector between the displayed points, then find its perpendicular component using the vector product.
Why this step? includes movement along the line direction. The vector-product ratio retains only the perpendicular gap.
Answer. units.
Check. The nearest point to on has . Its connector to is , perpendicular to , with squared length .
The next example changes only the displayed starting point of the second line, moving it one copy of along that line. Its geometric position and distance remain unchanged.
Worked example 2: any point on the parallel line works
Question. Determine the distance between above and
Plan. Use the new displayed point and the same common direction in the ratio.
Why this step? Adding a multiple of to the connector does not change its vector product with , because .
Answer. units.
Check. , so is another equation of .
Notice which vectors have which jobs. Subtract position vectors to make a connector, then use a direction vector for the base of the area calculation.
Watch out
Wrong: use the two parallel direction vectors as the vector-product numerator. Their product is zero, even for separate lines. Right: cross a connector between points with one common line direction.
Use the first line's direction in this problem; the negative multiple in the second equation does not change the geometry.
Using the supplied formula for skew lines
For skew lines, a common direction along the lines does not exist; instead, measure the separation in a direction perpendicular to both.
Take points with position vectors and , and non-parallel line directions and . The non-zero vector supplies the normal direction. Taking a scalar product of a connector with its unit vector measures the connector's component in that direction. This is the underlying geometry of the supplied formula, not a proof you need to reproduce.
Shortest distance between skew lines
For skew lines and , put . Then
In the formula booklet.
The numerator is a scalar product with a cross product; keep the two operations distinct. The absolute value handles either order of the points or either orientation of the common normal.
Worked example 3: the gap between the rails
Question. Determine the shortest distance between the skew lines
Plan. Cross the directions, then apply the supplied formula to the connector between the displayed points.
Why this step? The connector's -component lies along the span of the line directions. The scalar product with their vertical common normal ignores it and retains the gap .
Answer. units, resolving the opening question.
Check. The actual connector from on to on is perpendicular to both directions and has length .
The next example changes only the second line's starting height from to . The signed separation reverses, but the distance is still positive.
Worked example 4: a negative scalar-product numerator
Question. Determine the shortest distance between above and .
Plan. Use the unchanged cross product and retain the absolute value around the new scalar product.
Why this step? Choosing the opposite normal would reverse the numerator again. Neither a normal's orientation nor a point's side of the other line can make a distance negative.
Answer. units.
Check. The closest connector now joins to , again with length .
Any points on the lines work. Replacing their connector by leaves its scalar product with unchanged, because . This explains why the formula can use convenient displayed points even when those points are not the nearest pair.
Watch out
Wrong: apply the skew-line formula to parallel directions, obtaining . Right: check the directions first. Parallel lines use a point-to-line distance; non-parallel skew lines have a non-zero common normal.
If you need to verify proposed nearest endpoints, check that each belongs to its line and that their connector has zero scalar product with both directions. The following problem needs only the supplied ratio.
Quick Recap
- The shortest connector meets both lines perpendicularly; convenient starting points need not be its endpoints.
- Parallel lines reduce to a point-to-line distance using a common parallel direction.
- For skew lines, cross the directions, then take a connector's component along that common normal using the supplied formula.
- Keep distances non-negative, and never use the skew ratio when the directions are parallel.
The opening rails have shortest gap , although their displayed starting points are units apart.