# esda.shape.second_areal_moment¶

esda.shape.second_areal_moment(collection)[source]

Using equation listed on en.wikipedia.org/wiki/Second_moment_of_area#Any_polygon, the second moment of area is the sum of the inertia across the x and y axes:

The $$x$$ axis is given by:

$I_x = (1/12)\sum^{N}_{i=1} (x_i y_{i+1} - x_{i+1}y_i) (x_i^2 + x_ix_{i+1} + x_{i+1}^2)$

While the $$y$$ axis is in a similar form:

$I_y = (1/12)\sum^{N}_{i=1} (x_i y_{i+1} - x_{i+1}y_i) (y_i^2 + y_iy_{i+1} + y_{i+1}^2)$

where $$x_i$$, $$y_i$$ is the current point and $$x_{i+1}$$, $$y_{i+1}$$ is the next point, and where $$x_{n+1} = x_1, y_{n+1} = y_1$$. For multipart polygons with holes, all parts are treated as separate contributions to the overall centroid, which provides the same result as if all parts with holes are separately computed, and then merged together using the parallel axis theorem.

References

Hally, D. 1987. The calculations of the moments of polygons. Canadian National Defense Research and Development Technical Memorandum 87/209. https://apps.dtic.mil/dtic/tr/fulltext/u2/a183444.pdf