randomGaussian()

Category: Math

Subcategory: Random

Complexity: None

Description

Returns a float from a random series of numbers having a mean of 0 and standard deviation of 1. Each time the randomGaussian() function is called, it returns a number fitting a Gaussian, or normal, distribution. There is theoretically no minimum or maximum value that randomGaussian() might return. Rather, there is just a very low probability that values far from the mean will be returned; and a higher probability that numbers near the mean will be returned.

Related

Example

Code:
for (int y = 0; y < 100; y++) {
  float x = randomGaussian() * 15;
  line(50, y, 50 + x, y);
}
Preview: