how to measure infill of 3d shapes?

OR

What is the equation to calculate infill of 3d shapes?

And what exactly is it that you want to calculate/measure?

For example, do you want to measure the infill after printing a part or do you want to determine the required infill to reach a certain strength etc?