Computing the inertia operator of a rigid body