making random numbers deterministic
This commit is contained in:
		
							parent
							
								
									fa281752ef
								
							
						
					
					
						commit
						41a500e8fd
					
				| 
						 | 
					@ -111,9 +111,12 @@ function mouseDragStop() {
 | 
				
			||||||
function init() {
 | 
					function init() {
 | 
				
			||||||
	context = $('#canvas')[0].getContext('2d');
 | 
						context = $('#canvas')[0].getContext('2d');
 | 
				
			||||||
	clients = [];
 | 
						clients = [];
 | 
				
			||||||
 | 
						var v = 0.2;
 | 
				
			||||||
	data.matrix.forEach(function (times, index) {
 | 
						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 };
 | 
							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);
 | 
						$('#play').click(togglePlay);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue