# Thread: shortest distance between two lines

1. ## shortest distance between two lines

Show that the shortest distance between two lines l1 and l2 in R3 is achieved along a line that is perpendicular to both l1 and l2.

Im having trouble with this question, and its frustrating, does it have something to do with finding the normal vector to both lines?

2. Originally Posted by sterps
Show that the shortest distance between two lines l1 and l2 in R3 is achieved along a line that is perpendicular to both l1 and l2.

...
The line $\displaystyle l_1$ passes through the point A (It is labeled g in the attachment)

The line $\displaystyle l_2$ passes through the point B (It is labeled h in the attachment)

The equations of the lines are:

$\displaystyle l_1: \vec x = \vec a + r \cdot \vec u$ . The vector $\displaystyle \vec u$ is the direction vector of $\displaystyle l_1$ and it is painted in blue.

$\displaystyle l_2: \vec x = \vec b + r \cdot \vec v$ . The vector $\displaystyle \vec v$ is the direction vector of $\displaystyle l_2$ and it is painted in red.

The vector $\displaystyle \vec n$ is the result of the cross product of the 2 direction vectors:

$\displaystyle \vec n = \vec u \times \vec v$

Use the unit vector of n: $\displaystyle \overrightarrow{n^0} = \frac{\vec n}{|\vec n|}$ to calculate the distance d between the 2 lines:

$\displaystyle d = \frac{(\vec b - \vec a) \cdot \vec n}{|\vec n|} = \frac{(\vec b - \vec a) \cdot (\vec u \times \vec v)}{|\vec u \times \vec v|}$