# Distance between point and line in $\mathbb{R}^{3}$

Find the shortest distance from the point $P=(5,4,-6)$ to the line

$$(x,y,z)=(-7t,-2t,t)$$

So, I'm trying to find the shortest distance and here is my setup:

$$(x,y,z)=(0,0,0) + t(-7,-2,1)$$

Line equation: $-7x - 2y + z = 0$.

Using my point given I have $$\frac{-7(5) - 2(4) + (-6)}{\sqrt{(-7)^2 + (-2)^2 + 1^2} }$$

I get $6.395$ units.

What am I doing wrong here?

-
This could help. But you can indeed do that by calculus. You need to minimize the function $f(t)=\|\vec{PX_t}\|^2$ where $X_t=(-7t,-2t,t)$. That's a quadratic, so it should be ok. –  julien Mar 11 '13 at 0:06
add comment

## 2 Answers

The shortest distance between a point $P$ and a line $\ell$ will lie on a line $\ell '$ that is perpendicular to that line. Thus, you are looking to a line that lies in a plane $M$ that is perpendicular to $\ell$ and contains $P$. If you find $M$, you can more easily find $\ell '$. If you find $\ell '$, you can find the intersection of $\ell$ and $\ell '$, and then find the distance from this intersection to the original point $P$.

Does that help?

-
That was a little confusing but I get what you're saying. Although how would I find the equation of the plane in this case? –  Dimitri Mar 11 '13 at 0:40
add comment

Let the line be defined by $\mathcal{L} := \{ (-7t,-2t,t) : t \in \mathbb{R} \}$. The distance between $\mathcal{L}$ and $P$ is

$$\text{dist} (\mathcal{L},P) := \displaystyle\min_{t \in \mathbb{R}}\sqrt{ (7 t + 5)^2 + (2 t + 4)^2 + (t + 6)^2}$$

Let $t^* := \arg\min \sqrt{ (7 t + 5)^2 + (2 t + 4)^2 + (t + 6)^2}$ be the minimizer. Note that

$$t^* = \displaystyle\arg\min \{ (7 t + 5)^2 + (2 t + 4)^2 + (t + 6)^2\} = -\frac{3}{2}$$

and, therefore, we have that $\text{dist} (\mathcal{L},P) = \sqrt{ (7 t^* + 5)^2 + (2 t^* + 4)^2 + (t^* + 6)^2}$.

-
add comment