Shortest Distance between Two Skew Lines

​
a
1
8
a
2
0
a
3
8
b
1
-4
b
2
-4
b
3
-8
c
1
-8
c
2
0
c
3
4
d
1
6
d
2
6
d
3
-4
show plane for green line
show plane for blue line
show coordinates of P and Q
P is on the green line andQ is on the blue line.
δ = 5.750
plane for green line:
0.371
x-
0.927
y-
0.046
z =
2.597
plane for blue line:
0.371
x-
0.927
y-
0.046
z =
-3.153
P = {
1.600
,
-2.133
,
-0.533
}, Q = {
-0.533
,
3.200
,
-0.267
}
Select four points
A
,
B
,
C
,
D
in three dimensions to determine two lines
AB
(green) and
CD
(blue). For almost all choices of coordinates, the lines are skew: neither parallel nor intersecting. The goal is to find the shortest distance
δ
between the two lines. As a by-product, the shortest segment between the lines is shown in red.
Write the points as vectors
a=(
a
1
,
a
2
,
a
3
)
,
b=(
b
1
,
b
2
,
b
3
)
,
c=(
c
1
,
c
2
,
c
3
)
,
d=(
d
1
,
d
2
,
d
3
)
.
The cross-product of the directions of the lines is
(b-a)(d-c)
, which gives a vector perpendicular to both lines. The unit vector in this direction is then
n=(b-a)(d-c)/(b-a)(d-c)
. The equations
n·(x,y,z)=n·(b-a)
and
n·(x,y,z)=n·(d-c)
determine parallel planes through the two lines at distances
n·a=n·b
and
n·c=n·d
from the origin. Therefore,
δ=n·(a-c)
.
Here is one way to find the shortest line segment
PQ
connecting the two lines. Project the points
A
and
B
to the plane containing the line
CD
; call the projected points
A'
and
B'
. Let
P
be the intersection of
A'B'
and
CD
.
To find the intersection, express the lines in parametric form:
X=a'+t(b'-a')
and
X=c+t(d-c)
. Set the right-hand sides equal and solve for
t
. Substitute that value of
t
in either equation to find
P
.
Similarly for
Q
: Project the points
C
and
D
to the plane containing
AB
; call the projected points
C
' and
D'
. Let
Q
be the intersection of
AB
and
C'D'
.

External Links

Skew Lines

Permanent Citation

S. M. Blinder
​
​"Shortest Distance between Two Skew Lines"​
​http://demonstrations.wolfram.com/ShortestDistanceBetweenTwoSkewLines/​
​Wolfram Demonstrations Project​
​Published: October 8, 2021