1 package net.sf.openrocket.util;
3 import static net.sf.openrocket.util.MathUtil.pow2;
4 public final class Inertia {
11 * Return the rotational unit moment of inertia of a solid cylinder.
13 * @param radius the radius of the cylinder.
15 public static double filledCylinderRotational(double radius) {
16 return pow2(radius) / 2;
20 * Return the longitudal unit moment of inertia of a solid cylinder,
21 * relative to the midpoint lengthwise.
23 * @param radius the radius of the cylinder.
24 * @param length the total length of the cylinder (reference at midpoint)
26 public static double filledCylinderLongitudal(double radius, double length) {
27 return (3*pow2(radius) + pow2(length))/12;
32 * Return the unit moment of inertia that is shifted from the CG of an object
33 * by a specified distance. The rotation axis are parallel.
35 * @param cgInertia the unit moment of inertia through the CG of the object
36 * @param distance the distance to shift the rotation axis
38 public static double shift(double cgInertia, double distance) {
39 return cgInertia + pow2(distance);