The rotation sends \(e_1=(1,0)\) to \((0,1)\) and \(e_2=(0,1)\) to \((-1,0)\); those are the columns. The matrix \(\begin{pmatrix}0&1\\-1&0\end{pmatrix}\) rotates clockwise and \(\operatorname{diag}(1,-1)\) is a reflection.
The matrix \([T]\) of a linear transformation \(T\), with respect to given bases, has as columns the images of the domain basis vectors, written in coordinates of the codomain basis.
\[[T(v)]=[T]\,[v]\]
More practice problems: matrix of a linear transformation