[Math] Finding the coordinates of a point on a line that produces the shortest distance to another point in 3 dimensions.

3dvectors

I have a question with two parts and it looks like the following:

a) Determine the distance from point $A(-2, 1, 1)$ to the line with the equation $\vec{r} = (3, 0, -1) + t(1, 1, 2)$, $t\in \Bbb R$

b) What are the coordinates of the point on the line that produces this shortest distance?

The problem here is that the textbooks answers for some reason set $t= 0$ which does not make sense to me. With $t=0$ the answer is therefore $(3,0,-1)$. However, I think the textbook is incorrect (wouldn't be the first time).

Here is how I approached the problem that resulted in a different answer than the textbook:

Create parametric equation:
$x = 3 + t, y = t, z = -1 + 2t$

Use the parametric equations components to create a vector of $A$ and $\vec{r}$ components.

I will let $\vec{r} = P$ (the components of it).

So:
$$\vec{AP} = ((3+t)-2,t-1,(-1+2t)-1) \\
\vec{AP} = (t+1,t-1,2t -2)$$

Using the new vector I created and the direction vector of $\vec{r}$ I can use the dot product to solve for $t$ as $\vec{d} \cdot \vec{AP} = 0$

$$(t+1,t-1,2t-2) \cdot (1,1,2) = 0 \\
0 = t+1+t-1+4t-4 \\
0 = 6t – 4 \\
4 = 6t \\
t = \frac{4}{6} \\
t = \frac{2}{3}$$

Now subbing $t$ back into the parametric equation I created originally I get the following point: $(11/3,2/3,1/3)$ or for easier reading: $(33,6,3)$

The textbook however gets $(3, 0, -1)$ as the answer as they for some reason set $t = 0$.

Did I do something wrong or is the textbook wrong? The textbook is full of errors and I wouldn't doubt this is one, but I also doubt my own work.

Best Answer

That x drs must be $(3+t)-(-2)=5+t$ (not $t+1$). This will yield the correct answer. You can always check the distance if yours is less than the answer or not.