Пример #1
0
 /// <summary>
 /// Returns a random number that is distributed in accordance with standard normal distribution.
 /// I.e. a normally distributed variable with mean 0 and standard deviation 1.
 /// </summary>
 /// <param name="rnd">The System.Random to generate the numbers.</param>
 /// <returns>A standard normally distributed number.</returns>
 public static double Gaussian(this Random rnd)
 => GMath.Sqrt(-2 * GMath.Log(1.0 - rnd.NextDouble()));