Years ago I could have had a go at this but its too long ago to remember formulas now, it’s critical with ships and boats to make them stable and not want to roll over (they have a centre of buoyancy) but I think you are meaning the centre of mass, which is not the same as the C of G, especially...