Module 3: Distance Between a Point and a Line or Plane

From the introduction, we realize that the (shortest) distance between two objects will be along a line which is perpendicular to both of them. We will use this concept in one moment. But before we do so, let us review the definition of the distance between two points:

Let LaTeX: p_1p1 and LaTeX: p_2p2 be two points in the plane which are the heads of two vectors LaTeX: \vec{v}_1v1 and LaTeX: \vec{v}_2v2 as in the diagram below:

mod24Artboard 2.png

Then the distance between LaTeX: p_1p1 and LaTeX: p_2p2 is the same as the norm of the difference between the two vectors:

LaTeX: d(p_1,p_2) = \|\vec{v}_1 - \vec{v}_2 \|d(p1,p2)=

We will avoid an example of this (you can check out a prior module on the norm, or similar hw questions). Instead: note how this offers a game plan on how we can compute the distance between a point LaTeX: pp an another object:

  1. Find the direction perpendicular to a given object.
  2. Find a line through LaTeX: pp in that direction.
  3. Find where the point LaTeX: qq where this line intersects the object.
  4. Compute the distance between these two points.

In our first example, let's compute the distance between a point given by vector LaTeX: \vec{p}\vec{p} and the line LaTeX: \ell\ell given parametrically by LaTeX: \vec{x}_0 + t\vec{v}\vec{x}_0 + t\vec{v} as in the picture below:

mod24Artboard 3.png

Let us label LaTeX: \vec{q}\vec{q} the position on LaTeX: \ell\ell where the line through LaTeX: \vec{p}\vec{p} and LaTeX: \vec{q}\vec{q} meets LaTeX: \ell\ell orthogonally. Note that such a line will have direction LaTeX: \vec{p} - \vec{q}\vec{p} - \vec{q}. Since the direction of this line must be perpendicular to LaTeX: \ell\ell we use the dot product and create the equation:
LaTeX:  (\vec{p} - \vec{q}) \cdot \vec{v} = 0. (\vec{p} - \vec{q}) \cdot \vec{v} = 0.

Since LaTeX: \vec{q}\vec{q} lives on LaTeX: \ell\ell it must satisfy the equation LaTeX: \vec{q} = \vec{x}_0 + t \vec{v}\vec{q} = \vec{x}_0 + t \vec{v} for some LaTeX: tt. We can solve for this LaTeX: tt we will know the exact value of LaTeX: tt to compute the location of LaTeX: \vec{q}\vec{q}:

LaTeX: (\vec{p} - \vec{x}_0 - t \vec{v}) \cdot \vec{v} = 0 \Rightarrow t = \frac{(\vec{p} - \vec{x}_0) \cdot \vec{v}}{\|\vec{v}\|^2}.(\vec{p} - \vec{x}_0 - t \vec{v}) \cdot \vec{v} = 0 \Rightarrow t = \frac{(\vec{p} - \vec{x}_0) \cdot \vec{v}}{\|\vec{v}\|^2}.

Example:

Let's compute the distance between the point LaTeX: (1,0,-1)(1,0,-1) and the line given by LaTeX: \begin{pmatrix}
5 \\ 0 \\ 1
\end{pmatrix} + 
t \begin{pmatrix} -1 \\ 3 \\ 2
\end{pmatrix}.\begin{pmatrix} 5 \\ 0 \\ 1 \end{pmatrix} + t \begin{pmatrix} -1 \\ 3 \\ 2 \end{pmatrix}.

To solve, compute LaTeX: \vec{q} - \vec{p} = \begin{pmatrix}4 \\ 0 \\ 2\end{pmatrix} + t\begin{pmatrix}-1 \\ 3 \\ 2\end{pmatrix}\vec{q} - \vec{p} = \begin{pmatrix}4 \\ 0 \\ 2\end{pmatrix} + t\begin{pmatrix}-1 \\ 3 \\ 2\end{pmatrix}. We dot this against LaTeX: \begin{pmatrix} -1 \\ 3 \\ 2 \end{pmatrix}\begin{pmatrix} -1 \\ 3 \\ 2 \end{pmatrix} and set to zero to find LaTeX: 0+14t = 00+14t = 0. Therefore we can use LaTeX: t=0t=0 in the equation of the line to find  LaTeX: \vec{q} = 
\begin{pmatrix}
 5 \\ 0 \\ 1
\end{pmatrix}\vec{q} = \begin{pmatrix} 5 \\ 0 \\ 1 \end{pmatrix} We compute the distance between LaTeX: \begin{pmatrix}
1 \\ 0 \\ -1
\end{pmatrix}\begin{pmatrix} 1 \\ 0 \\ -1 \end{pmatrix} and LaTeX: \begin{pmatrix}
  5 \\ 0 \\ 1
 \end{pmatrix}\begin{pmatrix} 5 \\ 0 \\ 1 \end{pmatrix}to find that the distance between the point and the line is LaTeX: \sqrt{20}\sqrt{20}. Note that it is possible to redo the above distance measure using projections, which can give a nice formula. I encourage you to try and make one!

We will now move to the situation of computing the distance between a point and a plane. We need to find the direction perpendicular to a plane. But this is actually simple if the plane is represented in the form LaTeX: Ax+By+Cz=DAx+By+Cz=D since we know that the vector LaTeX: \begin{pmatrix}                                                                                                                                                                                                                                                           A \\ B \\C                                                                                                                                                                                                                                                          \end{pmatrix}\begin{pmatrix} A \\ B \\C \end{pmatrix}is the normal direction to the plane! Therefore the line LaTeX: \vec{p} + t\begin{pmatrix}A\\B\\C\\\end{pmatrix}\vec{p} + t\begin{pmatrix}A\\B\\C\\\end{pmatrix}

is perpendicular to the plane and passes through LaTeX: \vec{p}\vec{p}. We need only find where it intersects the plane!

mod24Artboard 4.png

Example:

Find the distance between the point LaTeX: (2,8,5)(2,8,5) and the plane LaTeX: 3x+6y-3z=43x+6y-3z=4.

First note that the line:

LaTeX: \begin{pmatrix}2\\8\\5\\\end{pmatrix} + t \begin{pmatrix}3\\6\\-3\\\end{pmatrix}\begin{pmatrix}2\\8\\5\\\end{pmatrix} + t \begin{pmatrix}3\\6\\-3\\\end{pmatrix}

is orthogonal to the plane. To find LaTeX: \vec{q}\vec{q} substitute the LaTeX: xx-, LaTeX: yy-, and LaTeX: zz-coordinates given by the line above into the given equation of the plane:

LaTeX: 3(2+3t) + 6(8+6t) -3(5-3t) = 4.3(2+3t) + 6(8+6t) -3(5-3t) = 4.

Solve this equation to find LaTeX: t=-\frac{35}{54}t=-\frac{35}{54}. Therefore the point LaTeX: \vec{q}\vec{q} in the plane that we want is

LaTeX: \begin{pmatrix}2\\8\\5\\\end{pmatrix} - \frac{35}{54} \begin{pmatrix}3\\6\\-3\\\end{pmatrix}\begin{pmatrix}2\\8\\5\\\end{pmatrix} - \frac{35}{54} \begin{pmatrix}3\\6\\-3\\\end{pmatrix}
(Do not worry about simplifying this).

Subtract LaTeX: \vec{p}\vec{p} from the above expression to get LaTeX: -\frac{35}{54} \begin{pmatrix}3\\6\\-3\\\end{pmatrix}.-\frac{35}{54} \begin{pmatrix}3\\6\\-3\\\end{pmatrix}. Now compute the norm:

LaTeX: \left\| -\frac{35}{54} \begin{pmatrix}3\\6\\-3\\\end{pmatrix} \right\| = \frac{35}{54} \sqrt{54} = \frac{35}{\sqrt{54}}\left\| -\frac{35}{54} \begin{pmatrix}3\\6\\-3\\\end{pmatrix} \right\| = \frac{35}{54} \sqrt{54} = \frac{35}{\sqrt{54}}

to get the distance.

As in the case of the distance between a point and a line, it is possible to generate a nice formula for the distance between a point and a plane. Try to do it!