Principal-axis reduction of a quadric (source code)

= Principal-axis reduction of a quadric
{title2=$x_0=-H^{-1}q$}

Write a real quadratic polynomial as $x^THx+2q^Tx+c$, with $H$ symmetric. If $H$ is invertible, translation by $x_0=-H^{-1}q$ removes the linear term. An orthonormal eigenbasis then makes the remaining <quadratic form> diagonal. Eigenvalue signs and the translated constant determine the real geometry, such as an ellipsoid or a <one-sheet hyperboloid>. A singular $H$ requires separate treatment of linear terms in its null directions; a center need not exist.