Orthogonal projection and reflection matrix Let $A$ represent orthogonal projection onto the plane $x+y+z=0$ and $B$ represent the reflection in the plane $x+y+z=0$. Determine $3\times 3$ matrix $A$ and $B$. All I know is that $A^2=A$. So in general how would you determine $A$ and $B$ if they are projection/reflection in the plane $ax+by+cz=0$?
 A: Here is a geometric way to do it. If $ \hat{n} $ is a normal vector to your plane, then projection of a vector $ v $ onto your plane is accomplished by subtracting from $ v $ its component along $ n $, ie $ A v = v - \hat{n} (\hat{n} \cdot v)  $. Note that $ \hat{n}(\hat{n} \cdot v ) = \hat{n} \hat{n}^T v $, which gives you a formula $ A = I - \hat{n} \hat{n}^T $.
Similarly, reflection is inverting the component of $ v $ along $ n $, ie $ B v = v - 2 \hat{n} ( \hat{n} \cdot v) $. ( You can check that $ (B v) \cdot \hat{n} = - v \cdot \hat{n} $ ) . There is a similar formula for $ B $.
So now you have to find $ \hat{n} $, I trust you can do that.
A: Method 1: to understand what is going on.  Choose a basis for $\def\R{{\Bbb R}}\R^3$ consisting of two vectors in the plane and one perpendicular to the plane, for example,
$$S=\{(1,-1,0),\,(0,1,-1),\,(1,1,1)\}\ .$$
Then for the projection $P$ we have
$$P(1,-1,0)=(1,-1,0)\ ,\quad P(0,1,-1)=(0,1,-1)\ ,\quad P(1,1,1)=(0,0,0)\ .$$
So the matrix of the projection with respect to the basis $S$ is
$$M=\pmatrix{1&0&0\cr0&1&0\cr0&0&0\cr}\ ,$$
and I expect you have learned how to convert this into the matrix $A$ of $P$ with respect to standard bases.  For the reflection, exactly the same except that
$$R(1,1,1)=-(1,1,1)\ .$$
Method 2: just using formulae.  Find an orthonormal basis for the plane, for example,
$$\{\,\tfrac1{\sqrt2}(1,-1,0),\,\tfrac1{\sqrt6}(1,1,-2)\,\}\ ;$$
let $Q$ be the matrix with these vectors as its columns; then $A=QQ^T$.  Let $\bf n$ be a column vector which is a unit normal to the plane; then
$$B=I-2{\bf n}{\bf n}^T\ .$$
For the plane $ax+by+cz=0$, both methods will be the same except that the basis vectors and normal vector will be different.
