# Shortest distance from point and line

We want to calculated a shortest distance form point $T(0,1,2)$ and from line of intersection of planes $x+y+z =0$ in $x-z+4=0$

I try this:

I have equate both equations

$x+y+z =x-z+4$

$y+2z =4$

I get 2 points:

$A(0,0,2)$

$B(0,2,1)$

$p= (0,0,2)+t(0,-2,1)$

$T_0=x_0 + \frac{\langle(x_1-x_0)p\rangle}{\langle p,p \rangle} p = (0,0,2)+\frac{ \langle(0,1,0)(0,-2,1)\rangle }{5} \cdot(0,-2,1)$

$= (0,0,2)- \frac{2}{5}(0,-2,1)=(0,\frac{4}{5},\frac{8}{5})$

I use that formula for distance.

$d (T,T_0) =\sqrt{ (x_1-x_0)^2 + (y_1-y_0)^2 + (z_1-z_0)^2}$

$=\sqrt{ 0+ (\frac{1}{5})^2+ (\frac{2}{5})^2} = \sqrt{ \frac{1}{25}+ \frac{4}{25}}$

$= \sqrt{ \frac{1}{5} }$

Is this the shortest distance? Thanks

• Your points A and B don't satisfy the two equations Nov 18 '13 at 14:26
• if you take A (0,0,2) is 0+2x2=4 and and for B (0,2,1) is 2+2x1=4 Nov 18 '13 at 14:30

Calculate the intersection line:

$$\begin{cases}x+y&+&z&=0\\x&-&z&=4\end{cases}\implies y=-4-2z\;,\;\;x=4+z$$

and the line is $\;(4,-4,0)+t(1,-2,1)\;,\;\;t\in\Bbb R\;$ , so the distance is

$$\frac{||\;\left[(0,1,2)-(4,-4,0)\right]\times\left[(0,1,2)-(5,-6,1)\right]\;||}{||\;(4,-4,0)-(5,-6,1)\;||}=\frac{||\;(-4,5,2)\times(-5,7,1)\;||}{||\;(-1,2,-1)\;||}=$$

$$\frac{||\;(-9,-6,-3)\;||}{\sqrt6}=\frac{\sqrt{126}}{\sqrt6}=\sqrt{21}$$

• where did you get this formula for distance ? -thanks Nov 18 '13 at 15:08
• This is high school stuff, but for example mathworld.wolfram.com/Point-LineDistance3-Dimensional.html Nov 18 '13 at 15:33
• You're right @LukaToni and that's what I got but somehow I didn't type the minus sign. Not that it matters in this case, of course. Thanks. Nov 18 '13 at 15:36
• No problem and thanks @DonAntonio Nov 18 '13 at 15:39
• Oh, dear: yes, it is. Another blunder. Good you check!. Thanks, I shall edit. Nov 18 '13 at 15:54