Finding the Center of Mass

Thanks to Pau Santos who requested a Physics 71 review two weeks ago, I was able to relearn the art of locating the center of mass.

Equation for locating the center of mass

Say we have a binarized image of an object, assuming that it has uniform density and symmetrical along the axis perpendicular to the plane of the image, we can find its center of mass with this simple bit of code in Scilab: