The geometrical method is based on the converging/diverging parallel lines. If the Universe is closed (density parameter Ω0 > 1) the parallel lines converge and the observed density of distant galaxies appears less than that expected by extrapolating the local density of galaxies backwards in time. Oppositely if the Universe is open (density parameter Ω0 < 1) , the parallel lines diverge and observed density of distant galaxies appears greater than expected.
In the computational method   it is necessary to sample a representative space region of the universe that is larger than the scale on which the Universe becomes sufficiently homogeneous and measure the masses of objects within the volume. The ratio of mass to volume gives the density ρ .
If the space region is the whole Universe, the volume is:
V = ( 4 * pi * \(R^3\)) / 3
where:
R is the radius of a sphere and it is equivalent at the distance of the most far object.
This distance will be determined using the Hubble Law :
R =  vr / Ho
where:
 vr is the recessional velocity, typically expressed in km/s.
Ho is Hubble’s constant or the ratio of velocity to distance in the expansion of the Universe at the time of observation.
The ”o” on Ho means the current value, since the Hubble ”constant” changes with time (but it is the same everywhere in the Universe at a given time).
But since vr = c * zmax :
R = c * zmax / Ho
where:
zmax  is the maximum redshift at the R distance.
c is the light velocity.
Then:
V = (4 * pi / 3) * (c * zmax / Ho)3 
The mass of the objects in the selected space region is determined using the virial theorem or one of its variants, which states that:
v2 = G * M / r
For hot X-ray gas in clusters of galaxies:
v  is the typical thermal velocity and is determined by the temperature of the gas.
r  is an effective radius and is determined using an angular size theta and the distance D = c * z / Ho.
so:  r = theta * D = theta * c * z / Ho.
M  is the mass,.
G  is Newton’s gravitational constant.
Therefore the mass is given by:
M = r * v2 / G  =  theta * c * z * v2 / ( G Ho)
Then:
ρ =  M / V = ( theta * c * z * v2 / (G * Ho) ) / ((4 * pi / 3) * (c * zmax / Ho)3 )
2. Calculation of the universe’s density by means of