Solution (source code)

= Solution

In a uniform <gravitational field>, the <centre of gravity> is the point $G$ through which the resultant <gravitational weight> acts. It coincides with the <center of mass>:
$$
\boxed{\mathbf r_G=\frac{1}{M}\int\mathbf r\,dm,\qquad
\mathbf W=M\mathbf g.}
$$
Indeed the sum of the elemental gravitational <torques> about any origin is
$$
\int\mathbf r\times\mathbf g\,dm
=M\mathbf r_G\times\mathbf g.
$$
Replacing the distributed gravitational forces by the resultant at $G$ therefore preserves both total force and torque. A strongly nonuniform field need not permit the same identification.

For equilibrium, all external forces and torques must balance. A freely suspended rigid body supported at a pivot requires $G$ on the vertical through that pivot. With $G$ below the pivot, a small angular displacement raises its gravitational <potential energy> and gives a restoring torque; with $G$ above it, the equilibrium is unstable. A body supported on a horizontal base can remain at rest under its weight only if the vertical projection of $G$ lies within the region that the support forces can sustain. At an edge the overturning <torque> becomes decisive.

For motion, the <center-of-mass equation> is
$$
\boxed{M\ddot{\mathbf r}_G=\sum\mathbf F_{\rm external}.}
$$
The centre moves as a particle carrying the total mass under the resultant external force, while rotation about it is governed by the external torque and <angular momentum>. This separates translation from rotation; it does not determine a rigid body's full orientation from its centre's trajectory alone. In uniform gravity and negligible air resistance, a thrown rotating body has a parabolic centre-of-mass path even while its parts follow more complicated paths.