Orthogonal diagonalization of a real symmetric matrix (source code)

= Orthogonal diagonalization of a real symmetric matrix
{title2=$A=Q\Lambda Q^T$}

A real <symmetric matrix> has real <eigenvalues>, orthogonal <eigenspaces> for distinct eigenvalues, and an <orthonormal basis> of eigenvectors. From diagonalizability, apply the <Gram-Schmidt process> within each eigenspace; all its linear combinations stay in that eigenspace. This gives $A=Q\Lambda Q^T$ with an orthogonal matrix $Q$ and real diagonal $\Lambda$.