Work out centroid of a polygon instantly with clear inputs, formula shown and shareable results.
The area centroid of a polygon weights each edge's cross product by the midpoint of that edge: Cx = (1/6A)Σ(xₖ + xₖ₊₁)(xₖyₖ₊₁ − xₖ₊₁yₖ), and similarly for Cy. This is not the same as the plain average of the vertices unless the polygon is regular.
Polygon centroid
Cx = (1/6A)Σ(xₖ+xₖ₊₁)·crossₖ, Cy = (1/6A)Σ(yₖ+yₖ₊₁)·crossₖ, A = ½Σcrossₖ
The centroid is (3, 2), the middle of the rectangle, with area 24.
Vertex averaging weights corners equally and gives the wrong answer whenever the edges have unequal lengths.