Center of gravity of a polygon

I am trying to write a PHP function that will calculate the center of gravity of a polygon.

I've looked at the other similar questions but I can't seem to find a solution to this.

My problem is that I need to be able to calculate the center of gravity for both regular and irregular polygons and even self intersecting polygons.

Is that possible?

I've also read that: http://paulbourke.net/geometry/polyarea/ But this is restricted to non self intersecting polygons.

How can I do this? Can you point me to the right direction?

20
задан Peter O. 1 July 2015 в 19:29
поделиться