Project the vector $\vec{v}$ on the line ${x=3t,y=t,z=2t}$ I'm trying to solve this problem:
Find the projection of $\vec{v}$ on the line
$$
W=
\begin{Bmatrix}
x=3t \\
y=t \\
z=2t
\end{Bmatrix}
=t
\begin{bmatrix}
3\\
1\\
2
\end{bmatrix}
$$
$\vec{v}$ is:
\begin{bmatrix}
-1\\
2\\
0
\end{bmatrix}
My solution:
If I choose $t=1$ then I get:
$\vec{x}=
\begin{bmatrix}
3\\
1\\
2
\end{bmatrix}$
Then I project $\vec{v}$ on $\vec{x}$:
$Proj_{\vec{x}}\vec{v}=\frac{\vec{v}\cdot\vec{x}}{\vec{x}\cdot\vec{x}}\vec{x}=-\frac{1}{\sqrt{14}}\begin{bmatrix}3\\1\\2\end{bmatrix}$
Is that correct?
 A: This is close. Note that $\vec x\cdot\vec x=14\neq\sqrt{14}$ so your denominator shouldn't have a square root. Other than that your solution is correct.
More generally, if $\{v_1,\dotsc,v_m\}$ is a basis for a subspace $V$ of $\Bbb R^n$, then the matrix of the orthogonal projection onto $V$ is 
$$
P=A(A^\top A)^{-1}A^\top
$$
where $A$ is the matrix whose columns are $\{v_1,\dotsc,v_m\}$. The formula for the projection of any vector $\vec x\in\Bbb R^n$ onto $V$ is $P\vec x$.
In your case
$$
A=\left[\begin{array}{r}
3 \\
1 \\
2
\end{array}\right]
$$
Thus
$$
P=
\left[\begin{array}{r}
3 \\
1 \\
2
\end{array}\right]\left(
\left[\begin{array}{rrr}
3 & 1 & 2
\end{array}\right]
\left[\begin{array}{r}
3 \\
1 \\
2
\end{array}\right]
\right)^{-1}
\left[\begin{array}{rrr}
3 & 1 & 2
\end{array}\right]
=
\frac{1}{14}
\left[\begin{array}{rrr}
9 & 3 & 6 \\
3 & 1 & 2 \\
6 & 2 & 4
\end{array}\right]
$$
Thus your projection is
$$
P
\left[\begin{array}{r}
-1 \\
2 \\
0
\end{array}\right]=
-\frac{1}{14}
\left[\begin{array}{r}
3 \\
1 \\
2
\end{array}\right]
$$
A: The closest point projection of $\vec{v}$ onto your line is the same as the orthogonal projection of $\vec{v}$ onto your line. The orthogonal projection is obtained by finding the unique $t$ for which
$$
        \left[\begin{array}{ccc}3 & 1 & 2\end{array}\right]\left(\left[\begin{array}{c}-1\\2\\0\end{array}\right]-t\left[\begin{array}{c}3\\1\\2\end{array}\right]\right) = 0. \\
         -1 - 14t =0 \\
           t=-\frac{1}{14}.
$$
So the projection of $\vec{v}$ onto your line is the point
$$
           -\frac{1}{14}\left[\begin{array}{c}3 \\ 1 \\ 2\end{array}\right]
$$
