# Is an inertia tensor in local-space always diagonal?

I'm looking at the implementation of a physics engine and I observe that the inertia tensor of a rigid body, in local-space coordinates, is stored as a 3 dimensional vector, rather than a 3x3 matrix, and the description says "A vector with the three values of the diagonal 3x3 matrix".

A diagonal matrix is one with all zero off-diagonal entries.

What I don't understand is why the inertia tensor in local coordinates would be diagonal? Why couldn't it have non-zero off-diagonal entries?

• github.com/DanielChappuis/reactphysics3d/issues/191 – Andrew Tomazos Feb 8 at 8:40
• Is there some method to get the principle axes of inertia? Basically these are the three eigenvectors you get when diagonalizing the inertia tensor (with SVD or some decomposition). – Emil Feb 9 at 7:05
• @Emil: No, I was wondering that too. It looks like the library approximates a body with a potentially non-diagonal inertia tensor by generating a diagonal inertia tensor (say based on its AABB). It doesn't rotate the body to its principle axes of inertia or anything like that. – Andrew Tomazos Feb 10 at 4:08
• The author of the library gave a good explanation, see the github link above. – Andrew Tomazos Feb 10 at 4:47

## 1 Answer

Think about what the inertia tensor is doing- it describes an objects resistance to rotational motion along each of the 3 axes. Each of the 3 elements which comprise the diagonal of the inertia tensor describe the resistance to motion along each of the 3 local space axes. If you made some of the elements in the column vectors non-zero, you would simply be limiting one of the other two axes- which is the natural result of applying a rotation to the inertia tensor.

Since any given object must have an origin and original orientation, it only makes sense to define them in local space as simply as possible, for both memory reasons as well as simplicity.

I suggest reviewing the polyhedral mass properties algorithm to gain a better understanding of how the diagonal is calculated. It is essentially a volume integral of a solid defined by triangular regions.

I should also mention that the inverse inertia tensor is the quantity actually used by a physics engine, so defining them as a diagonal makes the inverse process significantly simpler.

• Sorry but your understanding is not correct. The inertia tensor describes the resistance to rotation along any possible axis, not just the three basis axes. The off-diagonal terms are called "products of inertia", and are a necessary component to describe the angular mass along an arbitrary axis. I think I've figured out that the reason they are elided in this particular physics engine is that it only supports shapes that have diagonal inertia tensors (sphere, cube, etc), it approximates the inertia tensor of complex meshes with the inertia tensor of their AABB (which is again diagonal). – Andrew Tomazos Feb 8 at 8:38