Find the matrix of the projection of $\mathbb{R}^3$ onto the plane $x-y-z = 0.$
I can find a normal unit vector of the plane, which is $\vec{n}=(\frac{1}{\sqrt{3}},-\frac{1}{\sqrt{3}},-\frac{1}{\sqrt{3}})^T$
And then the vectors $\vec{u}=(1,1,0)^T, \ \vec{v} = (1,0,1)^T$ form a basis of $\mathbb{R}^3$. but why would the solution be $$A = \begin{pmatrix} 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}?$$
One normal vector to the plane is ${\bf n} = (1,-1,-1)$. I want to take a point $(x,y,z) \in \Bbb R^3$, consider the line through this point with direction $\bf n$, and see where it hits the plane. We have the line: $${\bf X}(t) = (x+t,y-t,z-t), \quad t \in \Bbb R.$$ I want $t_0$ such that ${\bf X}(t_0)$ satisfies the plane equation. So the relation we have is: $$x+t_0 - (y-t_0) - (z-t_0)=0 \implies x-y-z+3t_0 = 0 \implies t_0 = \frac{-x+y+z}{3}.$$ With this, $P(x,y,z) = \left(x+\frac{-x+y+z}{3}, y - \frac{-x+y+z}{3}, z - \frac{-x+y+z}{3}\right)$. We have $$\begin{align}P(1,0,0) &= (2/3, 1/3, 1/3) \\ P(0,1,0) &= (1/3, 2/3, -1/3) \\ P(0,0,1) &= (1/3,-1/3, 2/3)\end{align},$$ so the matrix would be: $$A = \frac{1}{3}\begin{pmatrix} 2 & 1 & 1 \\ 1 & 2 & -1 \\ 1 & -1 & 2\end{pmatrix}.$$