public class NormalRandom : Random
public double NextDouble(double mean, double variance)
double z = Math.Sqrt(-2 * Math.Log(base.NextDouble())) * Math.Cos(2 * Math.PI * base.NextDouble());
return Math.Sqrt(variance) * z + mean;
public static void Main()
NormalRandom rand = new NormalRandom();
Console.WriteLine(rand.NextDouble(3d, 2d));