Skip to content

centroidOfPolygon

Under Construction

This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/dot/blob/main/js/util/centroidOfPolygon.ts for the most up-to-date information.

Overview

Returns the centroid of the simple planar polygon using Green's Theorem P=-y/2, Q=x/2 (similar to how kite computes areas). See also https://en.wikipedia.org/wiki/Shoelace_formula.

@author Jonathan Olson <jonathan.olson@colorado.edu>

Source Code

See the source for centroidOfPolygon.ts in the dot repository.