Question: Find the distance from the point $B = (1, 1, 1)$ and the line l through the point $A = (-1, 1, 2)$ and the direction vector $d = [1, 0, 1]$.
Here is what I've found: Vector Form of line l (maybe?): $[-1, 1, 2] + t[1, 0, 1] = [-1+t, 1, 2+t] =$ I call it the vector $x$ And the parametric equations: $x = -1 + t$
$y = 1$
$z = 2 + t$
I think what I need to do is find the projection of vector b onto vector x which would be:
$(x•b)/(x•x) * x$ ...or its also equal to: $(x•b)/(|x|^2) * x$
So if all of my thinking is correct, my only problem is I don't know how to do a projection in $R^3$. Especially not with a vector in the parametric form which is all I can seem to get it in. Is there any advice, or a reference you can point me towards - I haven't been able to find any so far ...
How about minimizing the distance from $l$ to $B$? If you know any calculus, you know this can be done by setting the derivative of the distance function (a function of $t$), equal to zero...
As for projection, you seem to have the right formula. When you cover Graham-Schmidt you will get good at this...
So, $(B-A)\cdot d=(2,0,-1)\cdot(1,0,1)=1$. Divide by $\lvert d\rvert =\sqrt2$. Now by the Pythagorean theorem, we have ${\lvert B-A\rvert} ^2=(\frac1{\sqrt2})^2+D^2$. So $5=\frac12+D^2$. So $D=\frac3{\sqrt2}$...