Find the matrix of the orthogonal projection $ P \in \mathcal{L}(\mathbb{R^3}) $ onto $ U $ Question:
Let $ U $ be the subspace of $ \mathbb{R^3} $ that coincides with the plane through the origin that is perpendicular to the vector $ n = (1, 1, 1) \in \mathbb{R^3} $.
Find the matrix (with respect to the canonical basis) on $ \mathbb{R^3} $ of the orthogonal projection $ P \in \mathcal{L}(\mathbb{R^3}) $ onto $ U $ such that $ range(P) = U $
Approach:
First I find an orthonormal basis for U. Since $ U $ is the subspace that coincides with the plane, it will have dimension 2. Taking a basis $ (1, -1, 0) $ and $ (1, 0, -1) $, I can then apply the Gram-Schmidt process to achieve a valid orthonormal basis.
At this point I do not know how to taken an orthogonal projection onto U to meet the condition that $ range(P) = U $.
 A: If $\vec{q}=(x,y,z)$ is given, then the orthogonal projection of $\vec{q}$ onto a plane $\mathscr{P}$ passing through the origin is the unique $\vec{p} \in \mathscr{P}$ such that $(\vec{q}-\vec{p})\perp \vec{n}$. However, the only vectors orthogonal to $\mathscr{P}$ are scalar multiples of the normal vector $\vec{n}=(1,1,1)$. So, $\vec{p}$ must be chosen as the unique vector such that
$$
              \vec{q}-\vec{p} = t\vec{n},\;\; \vec{p} \perp \vec{n}.
$$
So $t$ must be chosen so that $(\vec{q}+t\vec{n})\cdot\vec{n}=0$, or
$$
                  t = -\frac{\vec{q}\cdot\vec{n}}{\vec{n}\cdot\vec{n}}.
$$
Then the orthogonal projection of $\vec{q}$ onto $\mathscr{P}$ is
$$
          P\vec{q}=\vec{p}=\vec{q}-t\vec{n}=\vec{q}-\frac{\vec{q}\cdot\vec{n}}{\vec{n}\cdot\vec{n}}\vec{n}.
$$
A: Express any point $(a,b,c)$ as a linear combination of $2^{-\frac 1 2} (1,-1,0)$,$2^{-\frac 1 2} (1,0,-1)$ and $3^{-\frac 1 2} (1,1,1)$. Once you do this simply drop the last term and you will get the projection.
