Shortest Distance Between Skew Lines: A Reliable Setup
Find the shortest distance between skew lines with a clear vector setup, Cartesian sign checks, solved examples, common perpendiculars and practice answers.
- 12th
You know the shortest-distance formula. You put the numbers in. Yet your answer differs from the one at the back of the book.
Before doing the entire calculation again, look at your first two lines of working. Did you read y + 3 as a point coordinate of 3? Did you take the coefficients outside the parameter as direction ratios? Did you use the same parameter for both lines?
These small setup errors can undo otherwise good vector work.
The shortest distance between skew lines is the length of their common perpendicular segment. Finding it becomes much easier when you separate the information into four objects: a point on each line and a direction vector for each line.
Let’s make that routine dependable, starting with the picture behind it.
What Are Skew Lines?
Imagine a straight road on the ground and a straight railway track on a flyover. Their routes may cross when viewed on a map, while their different heights keep them apart.
Two infinite straight lines are skew when they are neither parallel nor intersecting. No single plane contains both of them.
That last condition matters. Saying that lines are drawn on different planes is not enough: parallel lines can also be drawn on separate planes. Skew lines cannot be placed together in one plane at all.
Their shortest connecting segment meets both lines at right angles. An arbitrary segment joining a point on one line to a point on the other will usually be longer.
Think of sliding the two ends of a taut thread along the two routes. The shortest possible thread gives the distance we want.
The Four Objects to Write Before Calculating
Use the line equations:
L1: r = a + t u
L2: r = b + s v
Here, boldface is not needed: a, b, u, v and r represent vectors throughout this guide.
| Symbol | Meaning |
|---|---|
a | Position vector of a point A on L1 |
u | Nonzero direction vector of L1 |
b | Position vector of a point B on L2 |
v | Nonzero direction vector of L2 |
The parameters t and s vary independently over all real numbers. A point on one line does not need the same parameter value as a point on the other.
Next, form the joining vector:
w = b - a
Notice the roles. The vector u runs along the first line. The vector v runs along the second. The vector w joins your chosen points across the gap.
If these representations still feel unfamiliar, work through the guide to Cartesian and vector forms of lines first.
The Shortest-Distance Formula
For nonparallel direction vectors, calculate:
n = u × v
The cross product n is perpendicular to both directions. The required distance is:
d = |w · n| / |n|
Equivalently:
d = |(b - a) · (u × v)| / |u × v|
The dot is a dot product. The cross is a cross product. Bars around a scalar mean absolute value; bars around a vector mean its magnitude.
You do not have to convert direction ratios into direction cosines. The division by |n| already accounts for the length of the normal vector.
For component calculations, let u = (u1, u2, u3) and v = (v1, v2, v3). Then:
n1 = u2 v3 - u3 v2
n2 = u3 v1 - u1 v3
n3 = u1 v2 - u2 v1
With w = (w1, w2, w3), finish with:
d = |w1 n1 + w2 n2 + w3 n3| / sqrt(n1² + n2² + n3²)
The second component deserves special attention. If you use a determinant, remember the negative sign on the middle cofactor.
Why the Formula Measures the Right Gap
Take arbitrary points P = a + t u and Q = b + s v.
Their joining vector is:
Q - P = w + s v - t u
Now take its dot product with n. Since n is perpendicular to both u and v, the terms involving s and t disappear:
(Q - P) · n = w · n
So every connecting segment has the same component in the direction perpendicular to both lines. Sliding its endpoints can remove the other components, but cannot remove this one.
The shortest segment consists entirely of that perpendicular component. Dividing by |n| turns the dot product into its signed length, and the absolute value makes the distance nonnegative.
A useful second picture is a slanted box formed by w, u and v. Its volume is the absolute scalar triple product, while its base area is |u × v|. Volume divided by base area gives the perpendicular height.
Reading Cartesian Equations Without Sign Errors
Consider:
(x - 2)/3 = (y + 1)/(-2) = (z - 4)/5
Set each expression equal to t:
x = 2 + 3t
y = -1 - 2t
z = 4 + 5t
Now the information is clear:
- Point:
A = (2, -1, 4). - Direction:
u = (3, -2, 5).
Setting t = 0 is a quick way to verify the point. The numerator y + 1 means y - (-1), so its point coordinate is negative.
What If a Numerator Is Reversed?
For:
(3 - x)/2 = (y + 1)/4 = (z - 5)/(-1)
the first equation gives x = 3 - 2t. The direction vector is therefore (-2, 4, -1), and the point is (3, -1, 5).
Reading the denominators blindly would give the wrong sign on the first component.
What If One Direction Component Is Zero?
A line such as:
x = 2, (y - 1)/3 = (z + 4)/(-2)
has point (2, 1, -4) and direction (0, 3, -2).
The coordinate x stays fixed. There is no need to divide by zero. Use the fixed-coordinate statement together with the remaining parameter equations.
A single zero component is fine. The whole direction vector being zero is not: that describes a fixed point rather than a line.
Worked Example 1: Vector Form With a Full Check
Find the shortest distance between:
L1: r = (1, 0, 0) + t(1, 1, 0)
L2: r = (0, 2, 3) + s(1, 0, 1)
Step 1: Separate Points and Directions
a = (1, 0, 0), u = (1, 1, 0)
b = (0, 2, 3), v = (1, 0, 1)
Therefore:
w = b - a = (-1, 2, 3)
Step 2: Cross the Directions
n = u × v = (1, -1, -1)
Since n is nonzero, the directions are not parallel.
Check the result before going further:
n · u = 1 - 1 + 0 = 0
n · v = 1 + 0 - 1 = 0
Both dot products must vanish. This catches many cross-product mistakes immediately.
Step 3: Project the Joining Vector
w · n = (-1)(1) + 2(-1) + 3(-1) = -6
|n| = sqrt(1 + 1 + 1) = sqrt(3)
Hence:
d = 6/sqrt(3) = 2sqrt(3) units.
The nonzero numerator also establishes that these nonparallel lines are skew. Their chosen points are sqrt(14) units apart, so the answer being smaller than sqrt(14) is a useful reasonableness check.
Worked Example 2: Cartesian Form and Negative Coordinates
Find the distance between:
L1: (x - 1)/2 = (y + 2)/(-1) = (z - 3)/1
L2: (x + 1)/1 = (y - 1)/1 = (z - 2)/2
The setup is:
a = (1, -2, 3), u = (2, -1, 1)
b = (-1, 1, 2), v = (1, 1, 2)
Subtract the points in one consistent order:
w = (-2, 3, -1)
Now calculate:
u × v = (-3, -3, 3)
The numerator is:
|(-2)(-3) + 3(-3) + (-1)(3)|
= |6 - 9 - 3| = 6
The denominator is:
sqrt(9 + 9 + 9) = 3sqrt(3)
Therefore:
d = 2/sqrt(3) units.
You could simplify the normal vector from (-3, -3, 3) to (-1, -1, 1). That gives numerator 2 and denominator sqrt(3), leaving the same answer.
What you cannot do is simplify only the numerator or only the denominator. Both must use the same normal vector.
Worked Example 3: Finding the Closest Points
Sometimes the question asks for the endpoints of the shortest segment or the equation of the common perpendicular. The distance formula alone does not provide them.
Return to Example 1:
P = (1 + t, t, 0)
Q = (s, 2, 3 + s)
The vector joining these moving points is:
Q - P = (s - 1 - t, 2 - t, 3 + s)
At the closest points, this vector is perpendicular to both directions.
Using u = (1, 1, 0):
(Q - P) · u = 0
s + 1 - 2t = 0
Using v = (1, 0, 1):
(Q - P) · v = 0
2s + 2 - t = 0
The first equation gives s = 2t - 1. Substitute into the second:
2(2t - 1) + 2 - t = 0
3t = 0
Thus t = 0 and s = -1.
The closest points are:
P = (1, 0, 0) and Q = (-1, 2, 2).
Their joining vector is (-2, 2, 2), which is -2n. Its length is sqrt(12) = 2sqrt(3), matching the earlier distance.
The common perpendicular line can be written:
r = (1, 0, 0) + h(1, -1, -1).
It passes through P at h = 0 and Q at h = -2. The segment between them corresponds to -2 <= h <= 0.
Parallel, Intersecting or Skew: Which Formula Applies?
Always begin with n = u × v.
| Result | What it means |
|---|---|
n = 0 | Lines are parallel or coincident |
n != 0, w · n = 0 | Lines intersect |
n != 0, w · n != 0 | Lines are skew |
These tests assume two valid infinite lines in three-dimensional space.
Parallel Lines Need a Different Formula
If the directions are proportional, choose either nonzero direction vector u and calculate:
d = |w × u| / |u|
The numerator is now the magnitude of a vector, rather than the absolute value of a scalar triple product.
For example:
L1: r = (0, 0, 0) + t(1, 2, 0)
L2: r = (0, 0, 4) + s(2, 4, 0)
The directions are proportional. With w = (0, 0, 4):
w × u = (-8, 4, 0)
d = sqrt(80)/sqrt(5) = 4 units
This matches the picture: one line is four units directly above the other.
If the parallel-line formula returns zero, the two lines coincide. Substituting into the skew-line formula instead would produce 0/0, which tells you nothing about the distance.
Zero Distance With Nonparallel Directions
Consider:
L1: r = (0, 0, 0) + t(1, 1, 0)
L2: r = (2, 0, 0) + s(-1, 1, 0)
Here n = (0, 0, 2) and w = (2, 0, 0). Their dot product is zero.
The lines intersect at (1, 1, 0), with t = s = 1, and their shortest distance is zero. They are not skew just because the problem appeared in a shortest-distance exercise.
Five Mistakes Worth Catching Before the Final Answer
1. Taking the Distance Between the Given Points
|b - a| measures AB. It does not generally measure the gap between the lines. Your given points need not be the closest points.
2. Forcing the Same Parameter on Both Lines
Write t for one and s for the other. Even if a question happens to reuse a parameter symbol, the two lines represent independently varying sets of points.
In Example 3, the closest points required t = 0 and s = -1. Forcing equality would miss them.
3. Dropping the Absolute Value
The scalar triple product can be negative because it records orientation. A distance cannot be negative. Complete the dot product with its signs intact, then take its absolute value.
Do not take the absolute value of each term separately before adding.
4. Using the Product of Direction Magnitudes Below the Fraction
The denominator is |u × v|, not |u||v|. Those expressions agree only when the directions are perpendicular.
Likewise, replacing the cross product with a dot product changes the entire meaning of the calculation.
5. Checking Only Two Coordinates for Intersection
Two parameter values may satisfy the x and y equations but fail the z equation. A genuine intersection must satisfy all three simultaneously.
For a quick distance calculation, the cross product and scalar triple product avoid the need to solve for an intersection separately.
Does Choosing Different Points Change the Answer?
No, provided the replacement points lie on the correct lines.
Suppose you replace a with a + k u and b with b + m v. The new joining vector is:
w + m v - k u
Its dot product with n is still w · n, because v · n and u · n are both zero.
Reversing the subtraction order also leaves the distance unchanged. It reverses the sign of the numerator before the absolute value is taken.
Rescaling a direction vector by any nonzero number is valid too. The scaling changes the numerator and denominator by the same absolute factor.
These observations are useful checks when your working looks different from a textbook solution.
A Short Practice Set With Answers
Try each setup before reading the answer. All distances are in units.
Question 1: Read the Line
For (4 - x)/3 = (y + 2)/(-1) = z/2, identify a point and a direction vector.
Answer: Setting the common ratio to t gives x = 4 - 3t, y = -2 - t, z = 2t. Use point (4, -2, 0) and direction (-3, -1, 2).
Question 2: A Gap You Can Picture
Find the distance between r = (0, 0, 0) + t(1, 0, 0) and r = (0, 0, 5) + s(0, 1, 0).
Answer: The cross product is (0, 0, 1) and w = (0, 0, 5). Hence d = 5. The directions are perpendicular, but the lines do not intersect.
Question 3: Check for Parallelism First
Find the distance between r = (0, 0, 0) + t(1, 1, 0) and r = (0, 3, 0) + s(2, 2, 0).
Answer: The directions are parallel. Use w = (0, 3, 0) and u = (1, 1, 0). Since w × u = (0, 0, -3), the distance is 3/sqrt(2).
Question 4: A Nontrivial Skew Pair
Find the distance between r = (0, 0, 0) + t(1, 0, 1) and r = (0, 2, 0) + s(0, 1, 1).
Answer: n = (-1, -1, 1) and w · n = -2. Therefore d = 2/sqrt(3). Both tests are nonzero, so the lines are skew.
Question 5: Diagnose the Zero
For r = (0, 0, 0) + t(1, 0, 0) and r = (1, 1, 0) + s(0, 1, 0), what does the distance calculation tell you?
Answer: n = (0, 0, 1) and w · n = 0. The lines intersect, with t = 1, s = -1, at (1, 0, 0). Distance is zero.
Question 6: Is This a Valid Common Perpendicular?
For Example 1, a student writes r = (0, 0, 0) + h(1, -1, -1). Is this correct?
Answer: Its direction is correct, but its position is not. It does not even meet L1: the z coordinate forces h = 0, then the y coordinate forces t = 0, but the x coordinates disagree. Use the verified point (1, 0, 0) instead of the origin.
Your Final Answer Checklist
Before putting your pen down, check that you have:
- Identified a point and a nonzero direction vector for each line.
- Read every numerator sign carefully.
- Checked the cross product before choosing the formula.
- Verified that your normal is perpendicular to both directions.
- Used the magnitude of that same normal in the denominator.
- Applied the absolute value after completing the scalar calculation.
- Stated a nonnegative distance in units.
If the question also asks for the closest points, verify each point in its own line equation and check that their joining vector is perpendicular to both directions.
Further Reading
The standard distance formulas and projection approach are covered in NCERT’s Three Dimensional Geometry chapter, Sections 11.5.1 and 11.5.2, hosted by IIT Kanpur’s SATHEE. For another explanation of line representations, zero direction components and line classification, see OpenStax, Equations of Lines and Planes in Space.
Frequently Asked Questions
What is the shortest distance between two skew lines?
It is the length of the segment that joins the two lines and is perpendicular to both. For lines r = a + t u and r = b + s v, it equals |(b - a) · (u × v)| / |u × v|.
How do I prove that two lines are skew?
Show that u × v is nonzero and (b - a) · (u × v) is nonzero. The first rules out parallel directions; the second rules out coplanarity and intersection.
Can skew lines have zero shortest distance?
No. Two skew infinite straight lines in three-dimensional space have a positive shortest distance. A zero result with a nonzero cross product means the lines intersect, or that your calculation needs checking if the question says they are skew.
Can I use direction ratios without normalising them?
Yes. Any valid nonzero direction vectors work. You do not need unit direction vectors because the formula divides by the magnitude of their cross product.
Why did my scalar triple product come out negative?
Its sign depends on vector orientation and order. Keep the signed arithmetic until the dot product is complete, then take the absolute value to obtain a nonnegative distance.
What should I do if the cross product is zero?
The directions are parallel. Use |(b - a) × u| / |u|. If this is also zero, the lines coincide; otherwise it gives the positive gap between distinct parallel lines.
Are the given points always the closest points?
No. They are convenient reference points for describing the lines. To find the closest pair, use separate parameters and require the joining vector to have zero dot product with both directions.
Is a perpendicular direction enough to write the common perpendicular?
No. It supplies the direction but not the location. Find an appropriate point, usually an endpoint of the shortest connecting segment, and use that point in the line equation.
What if one direction ratio is zero?
That coordinate remains constant along the line. Write it as a fixed-coordinate equation and use parametric equations for the others. The vector methods still work as long as the entire direction vector is not zero.
Does the same formula work for two finite line segments?
Not automatically. It calculates the distance between the infinite supporting lines. If the closest points fall outside either segment, the segment distance requires boundary checks, including endpoint-to-segment distances.
Looking for commerce tuitions?
Prachi is a gold-medalist commerce teacher with experience at Deloitte and KPMG. She focuses on fundamentals to build a strong foundation.