We need moments 0, 1 and 2 of our blob.
For this we need the moments of a sliver with its point at the origin.
For a triangular surface element, let D be ½ the determinant of the coördinates of the three vertices.
For a sliver whose big end is the centroid at (X0, X1, X2) of those vertices we have:
M = D∫[0≤λ≤1]λ2dλ = D/3.
Mj = D∫[0≤λ≤1](λXj)λ2dλ = D Xj/4.
Mjk = D∫[0≤λ≤1](λXj)(λXk)λ2dλ = D XjXk/5.
N.B. j and k are coördinate identifiers, not exponents.
The block of code that includes the comment “turn” comes from this logic.
From this code which randomly samples one octant of a the unit sphere, I conclude that for the whole sphere
M ≃ 4.189 (4/3 π ≃ 4.1888)
and M00 ≃ 0.8379 (4/15 π ≃ 0.8378)
For what its worth we also learn that for the hemisphere where x>0,
M0 ≃ 0.785; M = 2.0944 and centroid is a (M0/M, 0, 0)
= (3.746, 0, 0)