Diagram shows a vertical bar of length h and width b. The centroid is centered on the vertical bar along the c axis. A parallel horizontal line is at a distance d below the c axis. A caption at the bottom below the parallel horizontal line reads: any axis parallel to centroidal axis c. This is  very important theorem to remember.

The equation

gives the moment of inertia of a rectangle about its own centroidal axis (axis c in the sketch).

Parallel-axis theorem

If the moment of inertia Ic for an area is known about a centroidal axis, the moment of inertia I of the area about a corresponding parallel axis can be computed from:

where d = perpendicular distance between the centroidal axis and any parallel axis and A = area of shape.

The moment of inertia for a rectangle