
Analytical Geometry 11
Figure 1.12: The distance between two lines in 3D.
two parameters s and t that yield these q
1
and q
2
:
q
1
= l
1
(s) = p
1
+ su ,
q
2
= l
2
(t) = p
2
+ tv .
The vector q
1
− q
2
is perpendicular to u and v:
h(p
1
− p
2
) + su − tv, ui = 0 ,
h(p
1
− p
2
) + su − tv, vi = 0 ,
leading to:
hp
1
− p
2
, ui + skuk
2
− thv, ui = 0 ,
hp
1
− p
2
, vi − tkvk
2
+ shu, vi = 0 .
Hence, we have two equations and two unknowns. Therefore we
solve for s and t:
˜s =
βhw, vi− kvk
2
hw, ui
kuk
2
kvk
2
− β
2
,
˜
t =
kuk
2
hw, vi− βhw, ui
kuk
2
kvk
2
− β
2
,
where β = hv, ui and w = p
1
− p
2
. Finally, we have
dist(l
1
, l
2
) = kl
1
(˜s) −l
2
(
˜
t )k.
Cross product.
1
We end this chapter with a quick review of
the notion of a