[![polygon](https://i.stack.imgur.com/EFaAP.gif)](https://i.stack.imgur.com/EFaAP.gif)  

(source: [polygonal.de](http://lab.polygonal.de/wp-content/assets/060817/pic_0.gif))  

[![triangle](https://i.stack.imgur.com/BsTSF.gif)](https://i.stack.imgur.com/BsTSF.gif)  

(source: [polygonal.de](http://lab.polygonal.de/wp-content/assets/060817/pic_1.gif))

$$ I\_{triangle} = \frac{b^3h-b^2ha+bha^2+bh^3}{36} $$

$$ I\_{total} = \sum^n\_{k=1}(I\_{triangle}+Md^2)\_k $$

Source is [here](https://web.archive.org/web/20160310031336/http://lab.polygonal.de/?p=57).

I'm trying to understand the mass moment of inertia in order to create a 2d physics engine, but I haven't found much resources to go by. One I did find was the above one, but I didn't fully understand it, and wanted to make sure about a few things before going through the effort of translating it into C++.

1. I am correctly understanding that this is for the *mass* moment of inertia and not something else like the area moment of inertia right?
2. What would $a$ be when the triangle is obtuse?
3. Is my understanding that the mass moment of inertia is dependent on the pivot point accurate, and that if the pivot moved away from the center of mass I'd just need to adjust the 'd's to get the new mass moment of inertia value?

Alternatively, if anybody is aware of a simpler way of going about getting the mass moment of inertia for a polygon, I'd love to hear it.