Shortest Distance between Two Skew Lines
Shortest Distance between Two Skew Lines
Select four points , , , in three dimensions to determine two lines (green) and (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.
A
B
C
D
AB
CD
δ
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 , which gives a vector perpendicular to both lines. The unit vector in this direction is then . The equations and determine parallel planes through the two lines at distances and from the origin. Therefore, .
(b-a)(d-c)
n=(b-a)(d-c)/(b-a)(d-c)
n·(x,y,z)=n·(b-a)
n·(x,y,z)=n·(d-c)
n·a=n·b
n·c=n·d
δ=n·(a-c)
Here is one way to find the shortest line segment connecting the two lines. Project the points and to the plane containing the line ; call the projected points and . Let be the intersection of and .
PQ
A
B
CD
A'
B'
P
A'B'
CD
To find the intersection, express the lines in parametric form: and . Set the right-hand sides equal and solve for . Substitute that value of in either equation to find .
X=a'+t(b'-a')
X=c+t(d-c)
t
t
P
Similarly for : Project the points and to the plane containing ; call the projected points ' and . Let be the intersection of and .
Q
C
D
AB
C
D'
Q
AB
C'D'
External Links
External Links
Permanent Citation
Permanent Citation
S. M. Blinder
"Shortest Distance between Two Skew Lines"
http://demonstrations.wolfram.com/ShortestDistanceBetweenTwoSkewLines/
Wolfram Demonstrations Project
Published: October 8, 2021