Modding:Random Functions: Difference between revisions

Jump to navigation Jump to search
m
mNo edit summary
Line 37: Line 37:
double num = Math.Sqrt(-2.0 * Math.Log(Stat.Rnd.NextDouble())) * Math.Sin(2.0 * Math.PI * Stat.Rnd.NextDouble());
double num = Math.Sqrt(-2.0 * Math.Log(Stat.Rnd.NextDouble())) * Math.Sin(2.0 * Math.PI * Stat.Rnd.NextDouble());
       return (double) Mean + (double) StandardDeviation * num;
       return (double) Mean + (double) StandardDeviation * num;
</syntaxhighlight>
</syntaxhighlight>Returns a random float around the mean with a probability density of a normal distribution.


===RandomCosmetic(int low, int high)===
===RandomCosmetic(int low, int high)===

Navigation menu