Distance and shortest distance
Two roads that cross on a map might really pass at different heights on a flyover — never touching, never parallel, just quietly skew in space. Three-dimensional geometry needs a way to measure "how far apart" two such lines really are, and also how far a stray point sits from a line it doesn't lie on. This section gives both measurements: the distance of a point from a line, and the shortest distance between two lines, with the skew case as the signature result. Both answers come from the same idea — the cross product turns a distance question into an area-over-base question, so no calculus is needed, only vectors you already know from earlier in this chapter.
The shortest distance between two lines is always measured along their common perpendicular, and the cross product converts that perpendicular length into a ratio of a triple-product "volume" to a cross-product "area."
The core idea
Three ways two lines in space can sit. Two lines either intersect, are parallel, or are skew — neither meeting nor parallel, lying in different planes (an overpass and the road beneath it). For lines and , the coplanarity test is
where: are position vectors of any point on each line and are their direction vectors. If this scalar triple product is zero the lines are coplanar (they intersect or are parallel); if it is non-zero, they are skew.
Distance of a point from a line. For point (position vector ) and line , dropping a perpendicular from gives
where: joins a known point on the line to , and is the line's direction. The cross product's magnitude is the area of the parallelogram spanned by these two vectors; dividing by the base leaves the height — exactly the perpendicular distance.
Shortest distance for parallel lines and (same direction ):
This is the point-from-line formula in disguise — any point on the second line measured against the first. For skew lines, no single perpendicular from a point works; instead there is a unique line segment perpendicular to both lines at once, and its length is the shortest distance — the subject of the derivation below. In Cartesian form, the same formulas apply once are read off as the given points and direction ratios, and every cross/dot product is expanded component-wise as a determinant. It helps to notice that all three formulas — point-from-line, parallel-lines, and skew-lines — are variations on one theme: turn the gap between two geometric objects into a vector, use a cross product to build a perpendicular quantity out of the directions involved, and divide by a length to leave behind a pure distance. The skew-line case is the richest because two independent directions are in play, so the perpendicular direction itself has to be constructed before any projection can happen; in the point-from-line and parallel-lines cases there is only one direction, , to work with throughout.
The goal is to find the length of the unique line segment that is perpendicular to both skew lines and simultaneously, starting only from their point-and-direction vector equations and the geometric meaning of the cross and dot products, without appealing to calculus or coordinates.
Step 1. Build a direction perpendicular to both lines at once. A vector perpendicular to and also perpendicular to is exactly , by the defining property of the cross product. This points along the common perpendicular direction — the one direction that meets both lines at right angles.
Step 2. Connect the two lines with a single vector. Pick any point on each line, giving position vectors and ; the vector joining them is . This vector generally has some component along and some component lying in the plane containing both directions .
Step 3. Isolate the component along the common perpendicular. Only the part of that lies along actually measures the separation between the lines, since motion along or keeps a point on its own line. The length of that projection is the scalar projection formula, .
Step 4. Substitute back in to get the shortest distance,
The numerator is the scalar triple product , geometrically the volume of the parallelepiped built from these three vectors; the denominator is the area of its base. Volume over base area is height — and that height is precisely the perpendicular distance between the two skew lines. If the lines are parallel instead and this formula does not apply; use the parallel-line formula there.
Worked example
Find the shortest distance between the skew lines and .
Step 1. Read off the vectors: , , , , so .
Step 2. Compute by the determinant
Step 3. Dot this with : . Since this is non-zero, the lines are confirmed skew.
Step 4. Find the magnitude , and divide: units.
The shortest distance between the two skew lines is units.
Competitive stretch
The same setup gives the point-from-line formula near-for-free: for and the line (through , direction ), , of magnitude , and , giving units — the identical cross-product-over-magnitude pattern, just with one line and one external point instead of two lines.
Common traps
- Using the parallel-lines formula (a plain cross product with a single ) on lines that are actually skew, or the skew formula on lines that are parallel — check whether and are proportional before choosing.
- Sign or cofactor-order slips inside the determinant when expanding or ; one misplaced sign changes the final distance.
- Dropping the absolute value at the end — a distance cannot be negative, even though the scalar triple product inside can come out negative.
- Declaring lines "intersecting" from a rough sketch instead of formally testing .
Ask the tutor: if setting up the determinant for feels error-prone, ask the AI tutor to walk through the cofactor expansion one row at a time with your own numbers.
How do I know whether to use the skew-line formula or the parallel-line formula?
Compare the direction vectors first. If and are scalar multiples of each other, the lines are parallel, and you use with either direction vector. If they are not proportional, compute ; if it is non-zero the lines are skew and you use the full triple-product formula. Checking proportionality takes seconds and avoids applying the wrong formula entirely.
Why does a non-zero scalar triple product mean the lines are skew rather than just non-parallel?
The scalar triple product is the volume of the parallelepiped formed by the connecting vector and the two directions. If this volume is exactly zero, all three vectors are coplanar, meaning the connecting vector, and hence both lines, lie in one plane — so the lines either meet or run parallel within that plane. A non-zero volume means the three vectors cannot fit in a single plane, so the lines cannot be coplanar; having ruled out both parallel and intersecting, only skew remains.
Is the distance of a point from a line just a special case of the skew-line formula?
Yes, in spirit. Treat the point as lying on an imaginary second "line" with zero length (any direction works since it never moves), and the connecting vector becomes . The role of collapses to just , the one line's direction, and the formula is exactly the same area-over-base logic: the cross product gives a parallelogram area, dividing by the base length gives the height, which is the perpendicular distance.