During an exam, we were asked to determine the standard matrix of the linear image, $P: \mathbb{R}^2 \rightarrow \mathbb{R}^2$ which projects a vector onto the $y=-x$ axis.
What I did is, I took the unit vector in the direction of the $y=-x$ axis, which is $\begin{bmatrix} 1 \\ -1 \end{bmatrix}$. Then I used the general formula for vector projection, using an arbitrary vector $\vec{x}$, with entries $x_1$ and $x_2$. In the answers model, they give that:
$ \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}$
A standard matrix is for projection. So is what I did unnecessarily difficult, or just wrong? In fact, I came up with:
$ \begin{bmatrix} \frac{1}{2} & -\frac{1}{2} \\ -\frac{1}{2} & \frac{1}{2} \end{bmatrix}$
After all, I now don't see how my answer matches theirs, if it were right, which I would think? What else is wrong with my approach?
Your "unit vector" isn't a unit vector, but your matrix is very much correct (the bottom one) for the question given. Their matrix is a reflection about the $x$-axis, mapping $y\mapsto-y$.
Notice also that their matrix has two linearly independent columns while yours has one linearly independent column, meaning your matrix has rank $1$, and theirs has rank $2$, meaning theirs isn't projection.