Maths Algorithms in C#: The Geometric Mean
The geometric mean is similar to the arithmetic mean in that it is a type of average for the data, except it has a rather different way of calculating it.
The geometric mean is defined as the n-th root of the product of each value in the data set, where n is the number of data points in the set. This makes it useful for describing things such as percentage growth.
The full sourcecode for the MathLib library is available at https://github.com/sjmeunier/mathlib
Originally posted on my old blog, Smoky Cogs, on 23 Oct 2009
Updated 5 Oct 2016: Updated code snippet after refactoring MathLib library