Using dot product when finding shortest distance between a line and a point, not working

3k Views Asked by At

Question goes as follows: Consider the points on a line; $A(1,3,-1)$ and $B(-1,4,-2)$. Find the point $Q$ on $L$ closest to the point $P(1,1,0)$.

My thinking: Closest distance from $a$ to $b$ is always a straight line, $90$ degree angle. Therefore: $$ Q⋅P=0 $$

$$ L= \left(\begin{array}{cc} 1\\ 3\\ -1\\ \end{array}\right) + t \left(\begin{array}{cc} -2\\ 1\\ -1\\ \end{array}\right) $$

$$ Q = \left(\begin{array}{cc} 1-2t\\ 3+t\\ -1-t\\ \end{array}\right) $$

$$ (1-2t)\times(1)+(3+t)\times(1)+(-1-t)\times(0)=0 $$ $$ 4-t=0 $$

$$t=4 $$ and $$ Q= \left(\begin{array}{cc} -7\\ 7\\ -5\\ \end{array}\right) $$

But it is wrong, my answer tells me a different story and when I graph it is wrong.

Answer $Q(2,5/2,-1/2)$

2

There are 2 best solutions below

2
On

Your method is incorrect.

You're supposed to find the point $Q$ such that the vectors $\vec{AQ}$ and $\vec{PQ}$ are perpendicular.

$\vec{AQ} = \vec{OQ} - \vec{OA} = \left(\begin{array}{cc} 2t\\ -t\\ t\\ \end{array}\right)$

$\vec{PQ} = \vec{OQ} - \vec{OP} = \left(\begin{array}{cc} -2t\\ 2+t\\ -1-t\\ \end{array}\right)$

Dot product the two and solve to get: $6t^2 + 3t = 0$.

Reject $t = 0$ (as this makes $Q$ coincident with $A$) to get $t = -\frac 12$, giving you the expected answer.

0
On

If you pay attention to your graph, you will see that what you need is $(-2,1,-1)\cdot(P-Q)=0$. That is, \begin{align} 0&=-2(1-(1-2t))+(1-(3+t))-(-(-1-t))\\ &=-6t-3,\\ \end{align} so $t=-1/2$, and your point in the line is $$ \left(\begin{array}{cc} 1-2(-1/2)\\ 3+(-1/2)\\ -1-(-1/2)\\ \end{array}\right) = \left(\begin{array}{cc} 2\\ 5/2\\ -1/2\\ \end{array}\right) $$