Shortest distance between two lines
Two straight lines drawn on a flat sheet of paper either meet or run parallel forever — there is no third option. Lift the same idea into three dimensions and a new possibility appears: two lines that never meet and are not parallel either, passing each other like two threads at different heights inside a box. These are called skew lines, and even though they never touch, there is always a well-defined "closest they ever get" — a single shortest distance between them, measured along the one line segment that is perpendicular to both at once. This article builds the general formula for that shortest distance, valid for both the skew case and the parallel case, using the vector cross product and scalar triple product already familiar from Vector Algebra. It closes the Three-Dimensional Geometry chapter of CBSE Class 12: given the equations of two lines, a student should be able to say whether they intersect, are parallel, or are skew, and — for the last two cases — compute exactly how far apart they are.
The shortest distance between two skew lines is the length of their common perpendicular, computed as the scalar triple product of the separation vector and the two direction vectors, divided by the magnitude of the cross product of those directions.
The core idea
Take two lines in vector form, and , where locate one point on each line and are their direction vectors. Comparing the two lines always lands in exactly one of three cases: they intersect, they are parallel, or they are skew.
Case 1 — skew or otherwise non-parallel lines. Whenever and are not parallel, is a nonzero vector perpendicular to both lines — the direction of the common perpendicular. Dotting it with , the vector joining a point on line 1 to a point on line 2, projects that separation onto this common-perpendicular direction, giving the shortest distance directly:
where: is the shortest distance, is the vector between the two given points, and is the cross product of the two direction vectors. The numerator, , is a scalar triple product, and the modulus bars around the whole fraction guarantee the answer is a non-negative length regardless of the sign the triple product happens to produce.
Case 2 — parallel lines. If and point along the same (or exactly opposite) direction, then and Case 1's formula divides by zero. Parallel lines never converge to a common perpendicular pinned by a cross product in that way; instead the distance is the length of the component of perpendicular to the common direction :
where: is the common direction of both lines (either or , since they are parallel), and the rest of the notation matches Case 1.
Reading . If the Case-1 formula evaluates to , the numerator scalar triple product is zero, which means , and are coplanar. Combined with the lines not being parallel, this forces them to actually meet at a point — the lines intersect. In Cartesian form, with points , and direction ratios , , the Case-1 formula becomes a ratio of a determinant to the same cross-product magnitude:
The goal is to compute, from the vector equations of two skew lines, the single number that represents how far apart they get at their closest approach — this is the calculation a CBSE board question most commonly asks, so the sequence below should become automatic: identify the four vectors, form the separation, cross the two directions, dot and divide.
Step 1. Write both lines in the form and , reading off directly from the given equations.
Step 2. Form the separation vector by subtracting corresponding components of the two given points.
Step 3. Compute the cross product using the determinant with in the top row; this gives the direction of the common perpendicular.
Step 4. Take the dot product of the Step 2 result with the Step 3 result — this scalar triple product is the numerator, and its sign is discarded at the end.
Step 5. Divide by (found from the same cross product in Step 3) and apply the modulus to obtain the final positive distance .
Worked example
Problem. Find the shortest distance between the lines and .
Step 1. Identify , , , . The direction ratios and are not proportional, so the lines are not parallel and this is a genuine skew-or-intersecting check.
Step 2. Compute the separation: .
Step 3. Compute the cross product:
Step 4. Dot the two results: .
Step 5. Compute the magnitude , then apply the formula:
The shortest distance is units, equivalently units.
Competitive stretch
Problem. Check whether and intersect.
Step 1. Parametrize: line 1 is ; line 2 is . Equating and gives and , which solve to .
Step 2. Check the -equation with these values: line 1 gives , line 2 gives . Since , no common satisfies all three coordinates, so the lines do not intersect; since their direction ratios and are not proportional either, they are skew, and the Case-1 formula above would be applied next to find how far apart they actually are.
Common traps
- Using the skew-line formula on parallel lines. If , the Case-1 formula divides by zero — always check for parallel direction ratios first and switch to the Case-2 formula if needed.
- Sign slip in the cross-product expansion, especially the middle () term, which carries a built-in minus sign that is easy to drop.
- Forgetting the final modulus. The scalar triple product in the numerator can be negative; the reported shortest distance is always taken as non-negative.
- Assuming a nonzero automatically means "skew" without checking parallelism. A nonzero distance only rules out intersection — confirm the direction ratios are not proportional before calling the lines skew rather than parallel-and-separated.
Ask the tutor: Want to work through another shortest-distance problem, or verify whether a given pair of lines is parallel, skew, or intersecting? Ask the AI tutor to walk through the calculation with you.
Why does the cross product of the two direction vectors give the direction of the common perpendicular?
The cross product is, by definition, perpendicular to both and individually. Since and are the direction vectors of the two lines, any vector perpendicular to both of them is perpendicular to both lines at once — exactly the direction the common perpendicular segment must point. Projecting the vector joining the two lines onto this direction isolates the true shortest separation, ignoring any sideways component along either line.
What happens if I plug parallel lines into the skew-line formula by mistake?
You get a zero in the denominator, since when the directions are parallel, so the calculation is undefined rather than merely wrong. Always compare the direction ratios first: if they are proportional (one is a scalar multiple of the other), the lines are parallel and you must use the separate parallel-lines formula, , instead.
If two lines are not parallel, does that automatically mean they are skew?
Not quite — it means they are either skew or intersecting, and you still have to decide which. Compute the scalar triple product : if it is zero, the two direction vectors and the separation vector are coplanar, and since the lines are not parallel, they must actually cross at a point, so and they intersect. Only when this triple product is nonzero, giving a genuine positive , are the lines truly skew.