Does anybody know a reference for the formula for the inertia tensor of a capped cylinder / capsule?
I always find the same equation but I actual want to understand the formula and not just use it, cause everybody does.
So the important part for me in the quote below:
Ia = M1*(REAL(0.25)*radius*radius + (REAL(1.0)/REAL(12.0))*M1*length*length) +
M2*(REAL(0.4)*radius*radius + REAL(0.375)*radius*length + REAL(0.25)*length*length);
I understood the following:
r = radius
l = length of cylinder
I = mass_of_cylinder * (1/4 * r * r + 1/12 * l* l) //formula for cylinder inertia
+
mass_of_sphere * (2/5 * r * r) //formula for sphere inertia
+
mass_of_sphere * (3/8 * r * l + 1/4 * l * l) //what's this for?
I can only assume it maybe has to do something with the distance to the center , so the inertia will grow.
Thanks for your help
This is how it's done in Open Dynamics Engine (ODE), and it work well for me too =D
void dMassSetCappedCylinder (dMass *m, dReal density, int direction, dReal radius, dReal length) { dReal M1,M2,Ia,Ib; dAASSERT (m); dUASSERT (direction >= 1 && direction <= 3,"bad direction number"); dMassSetZero (m); M1 = M_PI*radius*radius*length*density; // cylinder mass M2 = (REAL(4.0)/REAL(3.0))*M_PI*radius*radius*radius*density; // total cap mass m->mass = M1+M2; Ia = M1*(REAL(0.25)*radius*radius + (REAL(1.0)/REAL(12.0))*M1*length*length) + M2*(REAL(0.4)*radius*radius + REAL(0.375)*radius*length + REAL(0.25)*length*length); Ib = (M1*REAL(0.5) + M2*REAL(0.4))*radius*radius; m->_I(0,0) = Ia; m->_I(1,1) = Ia; m->_I(2,2) = Ia; m->_I(direction-1,direction-1) = Ib; # ifndef dNODEBUG checkMass (m); # endif }