Rigid-body kinetic energy about the centre of mass (source code)

= Rigid-body kinetic energy about the centre of mass
{title2=$T=\tfrac12M|v_G|^2+\tfrac12\omega\cdot L_G$}

Expanding the squared <velocity> $v_G+\omega\times r$ and integrating over mass removes the mixed term because the centre-of-mass first moment is zero. The remaining rotational <integral> is half the <scalar product> of <angular velocity> and <angular momentum about the centre of mass>. <Principal axes> diagonalize that rotational <quadratic form>.