From 41a500e8fd94dcbb93be44d984aaacc509ecad87 Mon Sep 17 00:00:00 2001 From: Micho Date: Wed, 22 May 2013 12:59:39 +0200 Subject: [PATCH] making random numbers deterministic --- clients/anim/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clients/anim/main.js b/clients/anim/main.js index 6d42013..2340d9e 100644 --- a/clients/anim/main.js +++ b/clients/anim/main.js @@ -111,9 +111,12 @@ function mouseDragStop() { function init() { context = $('#canvas')[0].getContext('2d'); clients = []; + var v = 0.2; data.matrix.forEach(function (times, index) { clients[index] = { point:undefined, x:0, y:0, r:0, x0:0, y0:0, r0:0, index:index, lastEvent:0, selected:false }; - random[index] = Math.random(); + + v = 3.999*v*(1-v); // bifurcation + random[index] = v; }); $('#play').click(togglePlay);