# Distance of a 3D point from the parametric form of a line?

I have calculated the parametric form of my line as: $X = (2,2,0) + t(1,2,2)$ and have been given a point $Q = (1,-1,-1)$, how would I calculate the distance from $Q$ to the line?

-

The line can be written as $X=(2+t, 2+2t, 2t).$ Then the direction cosines of the line joining the point $Q$ and a point on the line $P$ parametrised by $t$ is $(1+t, 3+2t, 1+2t)$.

This cosine should be perpendicular to the direction of the line for it to be the distance along which you will measure (and hence also the minimum), i.e. $$(1+t, 3+2t, 1+2t) \cdot (1,2,2) = 0$$

$t$ comes out to be $-1$. From this you know $P=(1,0,-2)$ and the point $Q$ between which you have to find the distance, which can be done easily with the distance formula:

$$Distance = \sqrt{(1-1)^2+(-1-0)^2+(-1+2)^2} = \sqrt{2}$$

-

First of all you have to notice that : $P \in X\Leftarrow \Rightarrow P(2+t;2+2t;2t) : t \in \Bbb R$. Then it's simple to calculate $PQ=\sqrt{(2+t-1)^2+(2+2t+1)^2+(2t+1)^2}=\sqrt{9t^2+18t+11}$. By saying the distance from Q from to the line, I assume you want the minimal value for the distance. So $\sqrt{9t^2+18t+11}$ is minimal if and only if $9t^2+18t+11$ is minimal. The last formula is a second degree polynomial with a minimum (because the coefficient of $t^2$ is positive). Then the minimum is given for $t=\frac{-18}{18}=-1$. Then substitute for $t=-1$ in the first distance calculation and we have : $PQ=\sqrt{2}\approx 1.14.$

-