Parallel axis theorem, cube (Confirm)

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 2K views
BoiledPotato
Messages
2
Reaction score
0
Parallel axis theorem, cube! (Confirm)

// Idisp = Icenter + mass[ (RdotR)*I - RcrossR ]

So to test it out, I create a long box at the origin, and then a smaller
box, half its width, so I can offset it along the x axis, and times it by
2, so it should equal the inertia tensor of the long box.

Is this correct?... why would it be wrong?

Thanx,

Jon

// ref: http://en.wikipedia.org/wiki/Parallel_axis_theorem

// Understanding?
float mass = 1.0f;
Matrix inertiabBox = BoxMatrix(mass/*mass*/, 3/*width*/, 10/*height*/, 50/*depth*/);
Matrix inertiaLongBox = BoxMatrix(mass/*mass*/, 6/*width*/, 10/*height*/, 50/*depth*/);

Vector3 R = new Vector3(3.0f,0,0); // Offset it by R
Matrix mA = inertiabBox + mass*( Vector3.Dot(R,R)*Matrix.Identity - OuterProduct(R,R) );

Matrix inertiaSameAsLongBox = 2 * mA; ? but why?


/* REF */
Matrix BoxMatrix(float mass, float w, float h, float d)
{
float ss = (1/12.0f) * mass;
Matrix bb = Matrix( ss*(h*h+d*d), 0, 0, 0,
0, ss*(w*w+d*d), 0, 0,
0, 0, ss*(w*w+h*h), 0,
0, 0, 0, 1 );
return bb;
}

Matrix OuterProduct( Vector3 a, Vector3 b)
{
return Matrix( a.X*b.X, a.X*b.Y, a.X*b.Z, 0.0f,
a.Y*b.X, a.Y*b.Y, a.Y*b.Z, 0.0f,
a.Z*b.X, a.Z*b.Y, a.Z*b.Z, 0.0f,
0, 0, 0, 1.0f );
}
 
Physics news on Phys.org
Problem sorted, my mistake, in my calculations I was making the assumption that mass was the same for both the smaller and larger box...should have been setting the density the same and recalculating the mass.

float mass0 = 0.5f;
float mass1 = 1.0f;
Matrix inertiabBox = BoxMatrix(mass0 /*mass*/, 3/*width*/, 10/*height*/, 50/*depth*/);
Matrix inertiaLongBox = BoxMatrix(mass1 /*mass*/, 6/*width*/, 10/*height*/, 50/*depth*/);

Vector3 R = new Vector3(1.5f,0,0); // Offset it by R
Matrix mA = inertiabBox + mass0*( Vector3.Dot(R,R)*Matrix.Identity - OuterProduct(R,R) );

Matrix inertiaSameAsLongBox = 2 * mA;

Thanx

Jon