GaussianRandomNext Method

Generates normally (Gaussian) distributed random numbers, using the Box-Muller transformation. This transformation takes two uniformly distributed deviates within the unit circle, and transforms them into two independently distributed normal deviates.

Definition

Namespace: KLib.Utilities
Assembly: KLib.Utilities (in KLib.Utilities.dll) Version: 1.0.0.0 (1.0.0.0)
C#
public double Next(
	double mu = 0,
	double sigma = 1
)

Parameters

mu  Double  (Optional)
The mean of the distribution. Default is zero.
sigma  Double  (Optional)
The standard deviation of the distribution. Default is one.

Return Value

Double
Random number ~ N(mu,sigma)

Exceptions

ArgumentOutOfRangeExceptionStandard deviation sigma must be positive.

See Also