Description
The Gaussian
method is an extension method for the System.Random
class, provided by the Sandbox.SandboxSystemExtensions
class. It generates a random floating-point number that follows a Gaussian (normal) distribution, characterized by a specified mean and standard deviation.
Usage
To use the Gaussian
method, you need to have an instance of System.Random
. You can then call this method to generate a random number with a Gaussian distribution. The method requires two parameters: mean
and stdDev
, which represent the mean and standard deviation of the distribution, respectively.
Example usage:
Random random = new Random();
float mean = 0.0f;
float stdDev = 1.0f;
float randomValue = random.Gaussian(mean, stdDev);
Example
Random random = new Random();
float mean = 0.0f;
float stdDev = 1.0f;
float randomValue = random.Gaussian(mean, stdDev);
// randomValue now contains a random number from a Gaussian distribution with mean 0 and standard deviation 1.