next up previous
Next: About this document ...

Math 8

May 5, 2000


Problem: Find the distance between the lines

$\displaystyle x+2y=3 \qquad\qquad\qquad\quad\qquad\qquad\qquad x+y+z=6$

$\displaystyle y+2z=3 \qquad\qquad\qquad\qquad\qquad\qquad\qquad x-2z=5$


Solution: First let's find vector parametric equations for each line.

For the first line, we'll start by finding two points on the line. The second equation tells us that

$\displaystyle y=3-2z$

and then from the first equation we can get

$\displaystyle x = 3-2y = 3-2(3-2z) = 4z-3.$

So the line is given by $ (x,y,z) = (4z-3, 3-2z, z)$; setting $ z=0$ and $ z=1$ gives us two points,

$\displaystyle (-3,3,0) \qquad\qquad\qquad (1,1,1).$

The vector between these points, $ 4\hat i -2 \hat j + \hat k$, is a vector in the direction of the line. Using this vector and the point $ (1,1,1)$ we can write the equation of the line as

$\displaystyle \vec r = \hat i + \hat j + \hat k + t(4\hat i -2 \hat j + \hat k).$

For the second line, we'll start by finding a vector in the direction of the line. Because the line lies in both planes

$\displaystyle x+y+z=6$

$\displaystyle x-2z=5,$

the direction of the line is normal to both normal vectors $ \hat i + \hat j +
\hat k$ and $ \hat i - 2\hat k$. That is, the line is in the same direction as their cross product,

$\displaystyle \left\vert\begin{matrix}
\hat i & \hat j & \hat k \cr
1 & 1 & 1 \...
...}\right\vert = (-2)\hat i - (-3)\hat j +(-1)\hat k = -2\hat i +3\hat
j -\hat k.$

To find a point on the line, we can use the trick of setting $ z=0$; then the second equation gives us $ x=5$ and the first gives us $ y=1$, so $ (5,1,0)$ is on the line. This line has vector parametric equation

$\displaystyle \vec r = 5\hat i + \hat j + t(-2\hat i +3\hat
j -\hat k).$

Now, as the textbook states in Example 9, to find the perpendicular distance between two lines, we just take any vector that goes from a point on one line to a point on the other, and find the length of its vector projection on a vector normal to both lines. (That's the absolute value of its scalar projection on a vector normal to both lines.)

Before we do this, let's try to imagine why this is true. Picture two lines in space. Imagine ``skew'' lines; they are not parallel, but they do not intersect. Now imagine a plane $ \pi_1$ parallel to both lines and containing the first line. For simplicity of imagination, pretend that plane is the floor, and the second line is at some distance above the floor; it is also horizontal, but not parallel to the first line. (Maybe the first line runs north-south and the second line heads off in an east-north-easterly direction. But they're both horizontal.) Imagine a second horizontal plane $ \pi_2$ containing the second line.

Now imagine yourself perched up above both of these planes staring down at them. You'll see a point where the two lines cross; they don't actually meet, but the second line lies directly above the first line at that point. That is the place where you can draw a vertical line between the two lines; becuase it is vertical, it is perpendicular to both of them, so its length is the perpendicular distance between the two lines, and its direction can be given by any vector perpendicular to both lines. Let's say that $ \vec n$ is a vector perpendicular to both lines.

Now that perpendicular distance between the two lines is just the perpendicular distance between the two horizontal planes. Let's let $ P$ be a point on the first line (in the bottom plane), $ Q$ be a point on the second line (in the top plane), and $ \vec w$ be the vector going from $ P$ to $ Q$. Since $ \vec w$ goes from the first plane to the second plane, the absolute value of the vertical component of $ \vec w$ is the distance between the two planes. And the vertical component of $ \vec w$ is its scalar projection on the vertical vector $ \vec n$. So the distance between the two lines is the absolute value of the scalar projection of $ \vec w$ on $ \vec n$.

Now let's forget about all the horizontal and vertical stuff. Here's what we saw: We take a vector $ \vec n$ normal to both lines. We take a point $ P$ on one line, a point $ Q$ on the other line, and the vector $ \vec w$ between $ P$ and $ Q$. The absolute value of the scalar projection of $ \vec w$ on $ \vec n$ is the distance between the two lines.

We know vectors in the direction of our two lines, so we can find a vector $ \vec n$ by taking their cross product:

$\displaystyle \vec n = \left\vert\begin{matrix}
\hat i & \hat j & \hat k \cr
4 ...
...x}\right\vert = (-1)\hat i - (-2)\hat j +(8)\hat k = -\hat i +2\hat
j +8\hat k.$

We know a point on each line, so we can find $ \vec w$ by subtracting their coordinates:

$\displaystyle \vec w = 4\hat i -\hat k.$

Finally the absolute value of the scalar projection of $ \vec w$ on $ \vec n$ is

$\displaystyle \left\vert \frac{\vec w \cdot \vec n}{\vert\vec n\vert}\right\vert = \left\vert
\frac{-12}{\sqrt{69}}\right\vert =\frac{12}{\sqrt{69}} ,$

and this is the distance between the two lines.

Just for fun, now that we know how to solve systems of linear equations, let's use the fact that these lines are given by systems of linear equations to find the first line. We start with our system of linear equations,

$\displaystyle x+2y=3 $

$\displaystyle y+2z=3 $

write down the augmented matrix of the system

$\displaystyle \left(\begin{matrix}
1 & 2 & 0 & \vdots & 3 \cr
0 & 1 & 2 & \vdots & 3 \cr
\end{matrix}\right),$

row-reduce it to get

$\displaystyle \left(\begin{matrix}
1 & 0 & -4 & \vdots & -3 \cr
0 & 1 & 2 & \vdots & 3 \cr
\end{matrix}\right),$

rewrite this as

$\displaystyle x-4z=-3$

$\displaystyle y+2z=3 $

and assign a paramter to $ z$ to get

$\displaystyle x = -3+4t$

$\displaystyle y = 3-2t$

$\displaystyle z=t.$

From this we can get a vector parametric equation,

$\displaystyle \vec r = -3\hat i +3\hat j +t(4\hat i - 2\hat j + \hat k).$

This tells us that the vector $ 4\hat i -2 \hat j + \hat k$ is in the direction of the line and the point $ (-3,3,0)$ is on the line.




next up previous
Next: About this document ...
Peter Kostelec
2000-05-05