This demo shows a cylindrical region hanging from a string colored according to a density function.  The white point is the center of mass of the region.

The "M" readout gives the total mass of the region.

The "XC", "YC", and "ZC" readouts give the x-center, y-center, and z-centers of mass respectively of the region.

This demo illustrates the fact that a hanging object will always hang with its center of mass directly below the point from which it is being hung.

Change the "r0" and "t0" variables to change the location at which the string is attached.