Simple Method for Calculating Moments of Inertia