I'm sorry for the weird title! I have a problem: Given is a point $p=\begin{pmatrix} 2\\ 2\\ 3 \end{pmatrix}$ and given is a line: $l(t)=\begin{pmatrix} 3\\ 3\\ 6 \end{pmatrix}+t \begin{pmatrix} 1\\ 0\\ 0 \end{pmatrix}$
I calculated the distance of $p$ to this line:
$$d=\frac{\left | \left ( \begin{pmatrix} 2\\ 2\\ 3 \end{pmatrix}- \begin{pmatrix} 3\\ 3\\ 6 \end{pmatrix} \right ) \times \begin{pmatrix} 1\\ 0\\ 0 \end{pmatrix} \right |}{\sqrt{1^2+0^2+0^2}}=\sqrt{10}$$
Now my question is; how do I find the point on the line so the distance between these two points (the point I'm searching and the point $p$) is $\sqrt{10}$ ?
I mean.. I got the distance. But I need the point on the line so the distance between these two points is $\sqrt{10}$. Which point gives me that and how do I calculate this point?
I hope my question is clear...I need this because I need to plot the distance correctly in Matlab :/
If you have to also find the foot of the perpendicular then it is easier to find that first and then you can easily find distance.
The points on the line is given by $(3 + t, 3, 6)$. Say the foot of the perpendicular from point $P (2, 2, 3)$ to the line is $T$, then
$\vec {PT} = (3 + t - 2, 3 - 2, 6 - 3) = (t+1, 1, 3)$
and we know the direction vector of the line is $ \ \vec d = (1, 0, 0)$.
As $PT$ is perpendicular to the line, dot product of $\vec {PT}$ and $\vec {d}$ must be zero.
$(t+1, 1, 3) \cdot (1, 0, 0) = t+1 = 0 \implies t = -1$
So point $T$ which is foot of the perpendicular is $T (2, 3, 6)$.
Now as you know coordinates of $P$ and $T$, you can find distance between them.