# 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?

please help!

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 $l_1$ passes through the point A (It is labeled g in the attachment)

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

The equations of the lines are:

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

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

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

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

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

$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|}$