--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolkit/exemples/couple/javascript/d3/src/core/random.js Thu Apr 10 14:20:23 2014 +0200
@@ -0,0 +1,15 @@
+d3.random = {
+ normal: function(mean, deviation) {
+ if (arguments.length < 2) deviation = 1;
+ if (arguments.length < 1) mean = 0;
+ return function() {
+ var x, y, r;
+ do {
+ x = Math.random() * 2 - 1;
+ y = Math.random() * 2 - 1;
+ r = x * x + y * y;
+ } while (!r || r > 1);
+ return mean + deviation * x * Math.sqrt(-2 * Math.log(r) / r);
+ };
+ }
+};