In linear algebra, an orthogonal diagonalization of a normal matrix (e.g. a symmetric matrix) is a diagonalization by means of an orthogonal change of coordinates.
The following is an orthogonal diagonalization algorithm that diagonalizes a quadratic form q(x) on R {\displaystyle \mathbb {R} } n by means of an orthogonal change of coordinates X = PY.
Then X = PY is the required orthogonal change of coordinates, and the diagonal entries of P T A P {\displaystyle P^{T}AP} will be the eigenvalues λ 1 , … , λ n {\displaystyle \lambda _{1},\dots ,\lambda _{n}} which correspond to the columns of P.