Matrix of orthogonal projection It was required to find the orthogonal projection of the vector $u =(0,1,0,2)$ onto 
$W=${$(x,y,z,t) \in \mathbb{R}^4 : x+y-t = 0$} and the matrix of the projection.
First, I've found a basis for $W$ and, use Gram-Schimidt process, an orthonormal basis. With it, I could do the first part of the problem.
Having an orthonormal basis for my space, can this make the job of finding the matrix of the projection easier? If it does, how can I found this matrix? 
Thanks in advance!
 A: 
Having an orthonormal basis for my space, can this make the job of
  finding the matrix of the projection easier? If it does, how can I
  found this matrix?

Yes! If $\{\mathbf{q}_i\}$ forms an orthonormal basis for the subspace $W$ that you want to orthogonally project onto, then the matrix of the orthogonal projection is is just $QQ^T$, where the columns of $Q$ are the $\mathbf{q}_i$.
More generally, if $\{\mathbf{p}_i\}$ only forms an orthogonal (but not necessarily orthonormal) basis for $W$, then the matrix of the orthogonal projection on to $W$ is $P(P^T P)^{-1}P^T$, where $\mathbf{p}_i$ form the columns of $P$.
A: You don’t need a basis for $W$. A normal vector for $W$
is $\overrightarrow{n}=(1,1,0,-1)$, so for a vector
$\overrightarrow{v}=(x,y,z,t)$ the projection $p(\overrightarrow{v})$ of $\overrightarrow{v}$ is simply 
$\overrightarrow{v}-\frac{(\overrightarrow{v}.\overrightarrow{n})\overrightarrow{n}}{||\overrightarrow{n}||^2}$.
Here we have
$$
\lambda=\frac{(\overrightarrow{v}.\overrightarrow{n})}
{||\overrightarrow{n}||^2}=
\frac{x+y-t}{3},
$$
so the coordinates of the projection are
$$
\left(
\begin{matrix}
x-\lambda &=& \frac{2x-y+t}{3} \\
y-\lambda &=& \frac{-x+2y+t}{3} \\
z &=& z \\
t+\lambda &=& \frac{x+y+2t}{3}
\end{matrix}
\right)
$$
So the matrix of the projection is
$$
\frac{1}{3}\left(
\begin{matrix}
2 & -1 & 0 & 1 \\
-1 & 2 & 0 & 1 \\
0 & 0 & 1 & 0 \\
1 & 1 & 0 & 2 \\
\end{matrix}
\right)
$$
In particular, the coordinates of the projection of
$\overrightarrow{u}$ is $\frac{1}{3}(1,4,0,5)$.
