gauss

 
 
 

Returns a random floating point number or vector. The number returned falls within a Gaussian (bell curve) distribution with mean value 0.

float gauss(float stdDev)

vector gauss(float XstdDev, float YstdDev)

vector gauss(vector stdDevVector)

stdDev specifies the value at which one standard deviation occurs along the distribution. This gives a one-dimensional Gaussian distribution.

XstdDev and YstdDev specify the values for one standard deviation. This gives a two-dimensional Gaussian distribution in the XY plane. The right component of the vector returned is 0.

stdDevVector specifies the vector component values for one standard deviation. This gives a three-dimensional distribution.

To control the random values returned by this function, see seed.

Example

gauss(5)

Returns a random floating point value such as 0.239.

If you were to execute gauss(5) repeatedly and chart the values returned, they would occur roughly with this frequency:

If you were to execute gauss(2) repeatedly, return values would occur with this frequency:

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License