- Home /

**closed**Oct 26, 2018 at 02:50 AM by Moaty5 for the following reason:

Question is off-topic or not relevant

# manually calculating Moment of Inertia

Hi,

I know that the rigidbody component calculates the inertia tensor automatically from the colliders attached on the object, but I am trying to find an algorithm that does that as well for some other purposes. so far I was able to write an algorithm that works with some shapes but not all shapes (specifically spherical shapes because of the integration over volume is different, it still thinks its a cubic shape) so I was wondering if someone could help.

Thanks in advance.

**Answer** by Bunny83
·
Sep 15, 2017 at 01:24 AM

I haven't done it myself yet, but I read a lot on that topic a few years ago. You can get the moment of inertia for a lot common shapes from this wikipedia page.

To combine them you would use the parallel axis theorem as mentioned on this SO post

I think this paper covers most of the math you need

first thanks for commenting ! the math needed is not the problem, the problem is using the system to calculate the inertia tensor of an object that has a mesh collider which could take any shape and form, there fails my current system where unity's rigidbody doesn't. so I am just wanting to calculate for mesh colliders not pre-known shapes.

Thanks again !

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.