I would like to calculate the angular acceleration of an object on which a force $F$ is applied at point $P$. The scene is 2D, and the complex object consists of many axis-aligned rectangles.
I calculated the mass center $O$ with the weighted average of the centroids of the rectangles.
After that the direction vector $r$ is $P-O$, and the torque can be calculated as: $ \tau = r \times F $, which in the 2D case is: $ r_x F_y - F_x r_y $
The angular acceleration can be calculated as $ \alpha = \frac{\tau}{I} $ where $I$ is the moment of inertia.
This is where I'm stuck. I have to calculate the moment of inertia of this object. I've found a page with the moments of area of simple objects. It says, that for a rectangle:
$$ I_x = \frac{bh^3}{12} $$ $$ I_y = \frac{b^3h}{12} $$
Why does the inertia has an $x$ and $y$ component? Almost all of the rectangles of my object have a diferent centroid from the origin. Where will the position and mass properties of the rectangles be used when calculation the moment of inertia?
Update
I solved the problem using this list, and the parallel axis theorem. The moment of inertia is:
$$ I = \sum_{i \ \in \text{ rectangles}} \frac{m_i}{12}(h_i^2 + w_i^2) + m_i (O_x - C_{i_x})^2 + m_i (O_y - C_{i_y})^2 $$
Where $C$ contains the centroids, $w$ and $h$ the sizes, and $m$ the masses of the rectangles.
