Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix math formatting in second_areal_moment #264

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions esda/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,16 +475,20 @@ def second_areal_moment(collection):
moment of area is the sum of the inertia across the x and y axes:

The :math:`x` axis is given by:

.. math::

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 :math:`y` axis is in a similar form:

.. math::

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 :math:`x_i`,:math:`y_i` is the current point and :math:`x_{i+1}`, :math:`y_{i+1}` is the next point,
and where :math:`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
where :math:`x_i`, :math:`y_i` is the current point and :math:`x_{i+1}`, :math:`y_{i+1}` is the next point,
and where :math:`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.

Expand Down