1.6 - The shortest distance between skew lines

1.6 - The shortest distance between skew lines

Skew lines are neither parallel nor intersecting, so their separation cannot be found by looking for a meeting point. You will construct a common normal, project onto it to find the shortest distance, and locate both ends of the common perpendicular.

A direction perpendicular to both

Two nonparallel lines in space need not meet. What direction must their shortest joining segment have? If it sloped along either line, moving its endpoint along that line could shorten it. At the minimum it must be perpendicular to both directions.

For instance, take

l:r=t(1,1,0),m:r=(2,0,1)+s(0,1,1).l:\mathbf r=t(1,1,0),\qquad m:\mathbf r=(2,0,1)+s(0,1,1).

They are nonparallel. An intersection would require t=2t=2 from the first coordinate, s=2s=2 from the second, but s=−1s=-1 from the third. Thus they do not meet: they are skew.

Common normal direction

For nonparallel lines with directions u,v\mathbf u,\mathbf v, the nonzero vector n=u×v\mathbf n=\mathbf u\times\mathbf v is a common normal: it is perpendicular to both directions. The line that meets both given lines at right angles is their common perpendicular.

A normal direction is only the first ingredient. Arbitrarily placing a line in that direction will usually miss at least one of the original lines. We will locate the endpoints in the final part.

Worked example 1: crossing line directions

Question. Find a common normal direction for the lines ll and mm above.

Plan. Cross their direction vectors and verify orthogonality.

n=(1,1,0)×(0,1,1)=(1,−1,1).\mathbf n=(1,1,0)\times(0,1,1)=(1,-1,1).

Answer. A common normal direction is (1,−1,1)(1,-1,1).

Check. (1,−1,1)⋅(1,1,0)=1−1=0(1,-1,1)\cdot(1,1,0)=1-1=0, and (1,−1,1)⋅(0,1,1)=−1+1=0(1,-1,1)\cdot(0,1,1)=-1+1=0. The vector is nonzero, so it defines a genuine direction.

Reverse and scale only the second line's direction. Its geometric direction is unchanged, so the common normal should change only by a nonzero scalar factor.

Worked example 2: an equivalent direction choice

Question. Find a common normal direction when the second line is written m:r=(2,0,1)+q(0,−2,−2)m:\mathbf r=(2,0,1)+q(0,-2,-2).

Plan. Cross the directions in the displayed order and simplify.

(1,1,0)×(0,−2,−2)=(−2,2,−2)=−2(1,−1,1).(1,1,0)\times(0,-2,-2)=(-2,2,-2)=-2(1,-1,1).

Answer. (−2,2,−2)(-2,2,-2), or equivalently (1,−1,1)(1,-1,1), is a common normal direction.

Check. Its scalar products with (1,1,0)(1,1,0) and (0,−2,−2)(0,-2,-2) are −2+2=0-2+2=0 and −4+4=0-4+4=0. Also s=−2qs=-2q shows that the new equation describes exactly the old second line.

If u×v=0\mathbf u\times\mathbf v=\mathbf0, the lines are parallel or coincident, and this construction gives no unique common normal. Do not put a zero normal into a distance formula. Parallel lines require, for example, projecting a joining vector perpendicular to their common direction, or finding a perpendicular foot. For nonparallel intersecting lines the common normal direction still exists, but their shortest distance is zero.

Watch out

Nonparallel does not mean intersecting in three dimensions. Check all three coordinate equations before claiming a meeting point.

Check a direction pair from another pair of lines.

Distance between skew lines

Any joining vector between two lines has a component in their common normal direction. That component cannot change when you move either endpoint along its own line, because both line directions have zero scalar product with the normal.

Write the lines as r=a+tu\mathbf r=\mathbf a+t\mathbf u and r=b+sv\mathbf r=\mathbf b+s\mathbf v, with n=u×v≠0\mathbf n=\mathbf u\times\mathbf v\ne\mathbf0. A joining vector is

w=(b−a)+sv−tu.\mathbf w=(\mathbf b-\mathbf a)+s\mathbf v-t\mathbf u.

Hence w⋅n=(b−a)⋅n\mathbf w\cdot\mathbf n=(\mathbf b-\mathbf a)\cdot\mathbf n, independently of s,ts,t. Every joining segment has length at least the magnitude of this fixed normal component. Because the independent vectors u,v\mathbf u,\mathbf v span the plane perpendicular to n\mathbf n, we can choose s,ts,t to cancel the tangential component. The remaining joining vector is normal to both lines, so the lower bound is attained.

[DIAGRAM: asset_name: The shortest joining segment; asset_slug: cam9231-skew-distance; caption: The common perpendicular removes the components along the two line directions; description: Exact oblique projection of the skew lines r equals t times (1,1,0) and r equals (2,0,1) plus s times (0,1,1). The common perpendicular joins P=(1,1,0) on the first line to Q=(2,0,1) on the second. The segment Q minus P=(1,-1,1) is highlighted. A separate projection panel shows an arbitrary joining vector split into a tangential part and a normal part of length square root 3.]
The common perpendicular removes the components along the two line directions

Shortest distance between nonparallel lines

d=∣(b−a)⋅(u×v)∣∣u×v∣.d=\frac{|(\mathbf b-\mathbf a)\cdot(\mathbf u\times\mathbf v)|}{|\mathbf u\times\mathbf v|}.

Use a point from each line and their nonparallel direction vectors. For skew lines this is positive. For nonparallel intersecting lines it is zero.

Not in the formula booklet: learn it.

The result does not depend on which base points you choose, because changing either point adds a multiple of a line direction. Reversing the joining vector or the normal also leaves the distance unchanged after taking the absolute value.

Worked example 3: a projection gives the separation

Question. Find the shortest distance between l:r=t(1,1,0)l:\mathbf r=t(1,1,0) and m:r=(2,0,1)+s(0,1,1)m:\mathbf r=(2,0,1)+s(0,1,1).

Plan. Cross the directions, then project the base-point joining vector onto the unit common normal.

Here n=(1,−1,1)\mathbf n=(1,-1,1), ∣n∣=3|\mathbf n|=\sqrt3, and b−a=(2,0,1)\mathbf b-\mathbf a=(2,0,1). Thus

d=∣(2,0,1)⋅(1,−1,1)∣3=33=3.d=\frac{|(2,0,1)\cdot(1,-1,1)|}{\sqrt3} =\frac3{\sqrt3}=\sqrt3.

Answer. The shortest distance is 3\sqrt3 units.

Check. Choose t=1t=1, s=0s=0. The points P=(1,1,0)P=(1,1,0) and Q=(2,0,1)Q=(2,0,1) have joining vector (1,−1,1)(1,-1,1), perpendicular to both lines and of length 3\sqrt3. Thus an actual joining segment attains the projected lower bound.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account