Newton–Euler, Lagrange and Kirchhoff formulations of rigid body dynamics: a unified approach