Moment of inertia analysis of rigid bodies using a smartphone magnetometer