# How can I find the shortest distance between the point (0,1,-1) and the line (x,y,z) = (2,1,3) + t(3,-1,-2)?

Apr 15, 2017

$d = \sqrt{\frac{138}{7}} \approx 4.44008$

#### Explanation:

Let ${p}_{0} = \left(0 , 1 , - 1\right)$ and
$l \to p = {p}_{1} + t \vec{v}$

with $p = \left(x , y , z\right)$, ${p}_{1} = \left(2 , 1 , 3\right)$ and $\vec{v} = \left(3 , - 1 , - 2\right)$

The square distance between $p$ and ${p}_{0}$ is given by

${d}^{2} = {\left\lVert p - {p}_{0} \right\rVert}^{2}$

substituting $p$ we have

${d}^{2} = {\left\lVert {p}_{1} + t \vec{v} - {p}_{0} \right\rVert}^{2}$.

Developing we have

${d}^{2} = {\left\lVert {p}_{1} - {p}_{0} \right\rVert}^{2} + 2 t \left\langle{p}_{1} - {p}_{0} , \vec{v}\right\rangle + {t}^{2} {\left\lVert \vec{v} \right\rVert}^{2}$

Here $\left\langle\cdot , \cdot\right\rangle$ represents the scalar product of two vectors.

The minimum distance from ${p}_{0}$ to $l$ is attained at ${t}_{0}$ such that ${d}^{2}$ has minimum value.

This occurs at a point ${t}_{0}$ such that

$\frac{d}{\mathrm{dt}} {d}^{2} = 2 \left\langle{p}_{1} - {p}_{0} , \vec{v}\right\rangle + 2 {t}_{0} {\left\lVert \vec{v} \right\rVert}^{2} = 0$

or

${t}_{0} = - \frac{\left\langle{p}_{1} - {p}_{0} , \vec{v}\right\rangle}{\left\lVert \vec{v} \right\rVert} ^ 2$ and the shortest distance is given by

$d = \sqrt{{\left\lVert {p}_{1} - {p}_{0} \right\rVert}^{2} + 2 {t}_{0} \left\langle{p}_{1} - {p}_{0} , \vec{v}\right\rangle + {t}_{0}^{2} {\left\lVert \vec{v} \right\rVert}^{2}}$

or simplifying

$d = \sqrt{{\left\lVert {p}_{1} - {p}_{0} \right\rVert}^{2} - {\left(\frac{\left\langle{p}_{1} - {p}_{0} , \vec{v}\right\rangle}{\left\lVert \vec{v} \right\rVert}\right)}^{2}}$

Here $\frac{\left\langle{p}_{1} - {p}_{0} , \vec{v}\right\rangle}{\left\lVert \vec{v} \right\rVert}$ is the projection of the segment ${p}_{1} - {p}_{0}$ into the line direction ($\vec{v}$) so it is an interesting form in which the Pythagoras theorem appears.

Finally, substituting values we obtain.

$d = \sqrt{\frac{138}{7}} \approx 4.44008$

Apr 15, 2017

We have line:

$\vec{l} \left(t\right) = \left\langle 2 , 1 , 3\right\rangle + t \left\langle 3 , - 1 , - 2\right\rangle$

and point $P = \left(0 , 1 , - 1\right)$

Let $Q$ be the point on line $\vec{l}$ that represents the shortest distance between $P$ and $\vec{l}$, with $Q = \vec{l} \left(\alpha\right)$, so:

$Q = \left(2 + 3 \alpha , 1 - \alpha , 3 - 2 \alpha\right)$

Now, $\vec{P Q}$ is the direction of the line of shortest distance going from $P \text{ to } Q$, and is:

$\vec{P Q} = \left\langle - \left(0 , 1 , - 1\right) + \left(2 + 3 \alpha , 1 - \alpha , 3 - 2 \alpha\right)\right\rangle = \left\langle 2 + 3 \alpha , - \alpha , 4 - 2 \alpha\right\rangle q \quad \triangle$

And $\vec{P Q}$ is going to be perpendicular to ${\vec{l}}_{d}$ (where ${\vec{l}}_{d} = \left\langle 3 , - 1 , - 2\right\rangle$ is the direction vector of line vec l), this being a fact of the geometry and the trade-off for not using calculus.

Therefore:

$\vec{P Q} \cdot {\vec{l}}_{d} = 0$.

$\implies \left\langle 2 + 3 \alpha , - \alpha , 4 - 2 \alpha\right\rangle \cdot \left\langle 3 , - 1 , - 2\right\rangle = 0$

$\implies \alpha = \frac{1}{7} \left[\implies Q = \left(\frac{17}{7} , \frac{6}{7} , \frac{19}{7}\right)\right]$

From $\triangle$ above:

$\left\mid \vec{P Q} \right\mid = \sqrt{{\left(2 + 3 \alpha\right)}^{2} + {\left(- \alpha\right)}^{2} + {\left(4 - 2 \alpha\right)}^{2}}$

$= \sqrt{\frac{138}{7}} \approx 4.4 \text{ units}$

Apr 15, 2017

Use the direction of the line to find the general equation of the plane.
Use the point to find the specific equation.
Use parametric formulas to find the point on the plane
Use the distance formula.

#### Explanation:

The direction of the given line is the vector $\left(3 , - 1 , - 2\right)$

Because the above vector must be a normal vector to the plane that contains the point closest to the given point, we know that its general form is:

$3 x - y - 2 z = c$

Find the specific plane that contains the given point, $\left(0 , 1 , - 1\right)$, by substituting and then solving for c:

$3 \left(0\right) - 1 - 2 \left(- 1\right) = c$

$c = 1$

The plane that contains the nearest point to the point $\left(0 , 1 , - 1\right)$ is:

$3 x - y - 2 z = 1 \text{ }$

The parametric equations of the line are:

$x = 3 t + 2$
$y = 1 - t$
$z = 3 - 2 t$

Substitute these equations into equation  and solve for t:

$3 \left(3 t + 2\right) - \left(1 - t\right) - 2 \left(3 - 2 t\right) = 1$

$9 t + 6 + t - 1 + 4 t - 6 = 1$

$14 t - 1 = 1$

$14 t = 2$

$t = \frac{2}{14} = \frac{1}{7}$

Using the parametric equations and the value of t, we can find the nearest point:

$x = 3 \left(\frac{1}{7}\right) + 2$
$y = 1 - \frac{1}{7}$
$z = 3 - 2 \left(\frac{1}{7}\right)$

$x = \frac{3}{7} + \frac{14}{7}$
$y = \frac{7}{7} - \frac{1}{7}$
$z = \frac{21}{7} - \frac{2}{7}$

$x = \frac{17}{7}$
$y = \frac{6}{7}$
$z = \frac{19}{7}$

Use the distance formula to find the distance from, $\left(0 , 1 , - 1\right)$ to $\left(\frac{17}{7} , \frac{6}{7} , \frac{19}{7}\right)$

$d = \sqrt{{\left(\frac{17}{7} - 0\right)}^{2} + {\left(\frac{6}{7} - 1\right)}^{2} + {\left(\frac{19}{7} - - 1\right)}^{2}}$

$d = \sqrt{{\left(\frac{17}{7}\right)}^{2} + {\left(- \frac{1}{7}\right)}^{2} + {\left(\frac{26}{7}\right)}^{2}}$

$d = \frac{\sqrt{966}}{7}$

$d \approx 4.44$