# How can I calculate the centroid of polygon?

What is the way to calculate the centroid of polygon? I have a concave polygon of 16 points, and I want know the centroid of that.

thanks

-
You've seen this? –  Ｊ. Ｍ. Dec 11 '11 at 14:09
As for a Mathematica routine: PolygonCentroid[pts_?MatrixQ] := With[{dif = Map[Det, Partition[pts, 2, 1]]}, ((ListConvolve[{1, 1}, #] & /@ Transpose[pts]).dif)/(3 Total[dif])]. Maybe somebody can do better than me... –  Ｊ. Ｍ. Dec 11 '11 at 14:19
thanks but i will be delighted if u could a bit explain me thx –  Csabi Dec 11 '11 at 14:22
Explain what? The formula? The code? You're a bit vague... –  Ｊ. Ｍ. Dec 11 '11 at 14:30
Label your 16 points $(x_1,y_1)$ through $(x_{16},y_{16})$. Then, according to the Wikipedia article...
$$C = \left(\frac{x_1+x_2+\cdots+x_{16}}{16}, \frac{y_1+y_2+\cdots+y_{16}}{16}\right)$$