title | desc | layout | published | indexed | categories | |
---|---|---|---|---|---|---|
Code Blocks |
Short, but powerful, drop-in code segments. |
default |
true |
true |
|
{% include header.html %}
By Dee Schaedler
def gaussian(mean, stddev)
theta = 2 * Math::PI * rand
rho = Math.sqrt(-2 * Math.log(1 - rand))
scale = stddev * rho
[mean + scale * Math.cos(theta), mean + scale * Math.sin(theta)]
end
By Dee Schaedler
def randr(min, max)
rand(max - min + 1) + min
end