On this page
When finding the distance between two lines in 3D geometry, you need to know whether the lines are skew or parallel before you begin calculating. The method you choose matters because the standard shortest-distance formula for skew lines breaks down entirely if you feed it parallel lines.
The distance between two parallel lines uses a single direction vector and a cross product to find the perpendicular height. Here is exactly how to calculate the shortest distance between two parallel lines in 3D, and why the math forces you to change methods.
How to find the shortest distance between two parallel lines in 3D?
Two parallel lines point in the exact same direction, meaning they share the same direction vector. In vector form, their equations look like this:
Line 1: r = a₁ + λb
Line 2: r = a₂ + μb
Here, a₁ and a₂ are position vectors of known points on the first and second lines, respectively. The vector b is the common direction vector for both lines.
The formula for the shortest distance d between them is: d = |b × (a₂ − a₁)| / |b|
The distance from a point to a line with direction vector b is given by the cross product magnitude divided by the direction vector magnitude/12%3A_Vectors_in_Space/12.05%3A_Equations_of_Lines_and_Planes_in_Space).
This formula uses the area of a parallelogram. The cross product b × (a₂ − a₁) produces a new vector whose magnitude is the area of the parallelogram formed by the direction vector b and the connecting vector (a₂ − a₁).
Because the area of a parallelogram is its base multiplied by its perpendicular height, dividing that area by the base length (|b|) leaves you with the exact perpendicular distance d between the two lines.
Why does the skew-line distance formula break down?
Skew lines are lines in 3D space that never intersect and are not parallel. They lie in completely different planes, much like an overpass crossing above a highway at an angle.
The formula for the shortest distance between two skew lines with separate direction vectors b₁ and b₂ is: d = |(b₁ × b₂) · (a₂ − a₁)| / |b₁ × b₂|
If you mistakenly apply this skew-line formula to parallel lines, you hit a mathematical wall. Parallel lines have the same direction, meaning b₁ is identical to (or a scalar multiple of) b₂. When you take the cross product of two parallel vectors, the result is the zero vector.
This makes the denominator |b₁ × b₂| equal to zero. Attempting to divide by zero breaks the formula entirely, which is why a distinct equation is required when dealing with parallel trajectories.
If you struggle to remember which formula applies when, the Fermi Concept Library can help you build an intuitive understanding of 3D geometry and vector products.
What is the geometry behind the parallel line formula?
When you memorise equations without picturing the geometry, you are more likely to apply the wrong one under exam pressure. The parallel line distance formula is not a random collection of vectors; it is a direct application of right-angled trigonometry.
If you draw a line segment connecting the point on the first line (a₁) to the point on the second line (a₂), you create the vector (a₂ − a₁). This connecting vector acts as the hypotenuse of a right-angled triangle. The angle θ between this connecting vector and the direction vector b dictates the perpendicular distance.
Using basic trigonometry, the opposite side of this triangle—which is the perpendicular distance d—is equal to the hypotenuse multiplied by the sine of the angle: d = |a₂ − a₁| sin θ.
The cross product naturally includes the sine of the angle. The magnitude of the cross product is defined as |b × (a₂ − a₁)| = |b| |a₂ − a₁| sin θ. If you divide this term by |b|, the |b| components cancel out. This leaves exactly |a₂ − a₁| sin θ, which is the exact distance d.
This geometric logic is foolproof. It works for any two parallel lines in 3D space, regardless of which specific points you pick for the position vectors a₁ and a₂.
A worked example: how to calculate the distance between two parallel lines?
Let us find the distance between the following parallel lines:
Line 1: r = (i + 2j − 4k) + λ(2i + 3j + 6k)
Line 2: r = (3i + 3j − 5k) + μ(2i + 3j + 6k)
Step 1: Identify the vectors Extract the points and the shared direction vector from the equations: a₁ = i + 2j − 4k a₂ = 3i + 3j − 5k b = 2i + 3j + 6k
Step 2: Find the difference vector Subtract the position vector a₁ from a₂: a₂ − a₁ = (3 − 1)i + (3 − 2)j + (−5 − (−4))k a₂ − a₁ = 2i + j − k
Step 3: Calculate the cross product Compute b × (a₂ − a₁) using a determinant: b × (a₂ − a₁) = i(−3 − 6) − j(−2 − 12) + k(2 − 6) This simplifies to −9i + 14j − 4k.
Step 4: Find the magnitudes Find the magnitude of the resulting cross product: |b × (a₂ − a₁)| = √( (−9)² + 14² + (−4)² ) |b × (a₂ − a₁)| = √(81 + 196 + 16) = √293
Next, find the magnitude of the shared direction vector b: |b| = √(2² + 3² + 6²) = √(4 + 9 + 36) = √49 = 7
Step 5: Divide to find the distance Substitute these calculated values into the parallel lines formula: d = √293 / 7
The shortest distance between the two lines is exactly √293 / 7 units, or roughly 2.45 units. By relying on the cross product to establish the area, you avoid the division-by-zero error and arrive at a precise geometric distance. For a broader overview of applying vector methods, check how to handle collinear points with vectors and the section formula in 3D.



