# How to calculate the center of mass of a cut sphere

I did a study in a CAD software (SolidWorks) to get the center of mass of a sphere that is cut at the bottom.  Using trigonometry I was able to obtain the ratio of the diameter cut under the sphere to the initial center of the sphere. With the code below I make the values ​​valid:

ClearAll["Global*"]
diametro = {0, 2, 4, 6, 8, 10};
h = N[Solve[5^2 == h^2 + (diametro[[#]]/2)^2, {h}]]&/@Range[Length[diametro]] /. Rule -> Set;
h = Take[h, All, {2}] // Flatten


Based on the equation of the figure below I obtained the values ​​of the centers of mass for each configuration of sphere: r = 5; H = h + r y = (3 (2 r - H)^2)/(4 (3 r - H)) // N


The question is:

Is there a different way to get the center of mass through solids?

• I tried using RegionCentroid, but I have not yet succeeded May 19, 2017 at 16:59

Define solid:

cutBall[r_, h_] :=
RegionDifference[Ball[{0, 0, 0}, r],
HalfSpace[{0, 0, 1}, {0, 0, -h}]]

solids = cutBall[r, #] & /@ h;

GraphicsRow[
BoundaryDiscretizeRegion[#, ViewPoint -> Front] & /@ solids] Compute centroid (we only need z-axis value):

RegionCentroid[#][] & /@ solids
`

{0., 0.00150046, 0.0241226, 0.125, 0.428572, 1.875}