1 #ifndef BLOBS_MATH_DISTRIBUTION_HPP_
2 #define BLOBS_MATH_DISTRIBUTION_HPP_
13 Distribution(double mean = 0.0, double stddev = 1.0) noexcept
19 double Mean() const noexcept { return mean; }
20 double StandardDeviation() const noexcept { return stddev; }
21 double Variance() const noexcept { return stddev * stddev; }
23 /// convert uniform random value in [-1,1] to fake normal distribution
24 /// in [mean - 2 stdddev,mean + 2 stddev]
25 double FakeNormal(double uniform) const noexcept {
26 return mean + (uniform * uniform * stddev) + std::abs(uniform * uniform * uniform) * stddev;