Traceless symmetric two-by-two matrix (source code)

= Traceless symmetric two-by-two matrix
{title2=$M=\begin{pmatrix}a&b\\b&-a\end{pmatrix},\quad\lambda_\pm=\pm\sqrt{a^2+b^2}$}

For real $a,b$, the displayed <symmetric matrix> satisfies $M^2=(a^2+b^2)I$. If $s=\sqrt{a^2+b^2}>0$, choose $\theta$ with $\cos2\theta=a/s$ and $\sin2\theta=b/s$. The <eigenvectors> $(\cos\theta,\sin\theta)$ and $(-\sin\theta,\cos\theta)$ are <orthonormal> and have <eigenvalues> $s$ and $-s$. The half-angle description works even when $b=0$, avoiding an artificial division by an off-diagonal entry. If $s=0$, the matrix is zero and every direction is an eigenvector. The normalized matrix $M/s$ is reflection in the axis at angle $\theta$.