RobertKipling 0 Posted October 24, 2007 To generate numbers on a bell curve, call this function with the mean and the standard deviation of the desired output. (This code was found elsewhere and adapted for AutoIt - use it if you find an application!) Func randNorm($mean, $stddev) $x1=0 $x2=0 $w=2 $y1=0 $y2=0 While ($w >= 1.0) $x1 = 2.0 * Random() - 1.0 $x2 = 2.0 * Random() - 1.0 $w = $x1 * $x1 + $x2 * $x2 WEnd $w = Sqrt((-2.0 * Log($w)) / $w) $y1 = $x1 * $w $y2 = $x2 * $w Return $y1 * $stddev + $mean EndFunc Share this post Link to post Share on other sites
jvanegmond 307 Posted October 24, 2007 Bell Curve? I'm curious. github.com/jvanegmond Share this post Link to post Share on other sites