Function PGARandomGaussian

Function Documentation

double PGARandomGaussian(PGAContext *ctx, double mean, double sigma)

Return an approximation to a Gaussian random number.

Example

To generate a Gaussian random number with mean 0.0 and standard deviation 1.0 use

PGAContext *ctx;
double r;

...
r = PGARandomGaussian (ctx, 0.0, 1.0);

Parameters
  • ctx – context variable

  • mean – the mean of the Gaussian distribution

  • sigma – the standard deviation of the Gaussian distribution

Returns

A random number selected from a Gaussian distribution with given mean and standard deviation