xxxxxxxxxx
// function setup() {
// createCanvas(windowWidth, windowHeight);
// background(100);
// cent_x = width/2;
// cent_y = height /2;
// }
// function draw() {
// // Pick a mean / average value e.g 150 and a std deviation from that value e.g 100. smaller std-dev values have a sharp drop off bell curve
// var gaus = randomGaussian(150, 200);
// //ellipse(mouseX, mouseY, 20, 20);
// ellipse(cent_x , cent_y, gaus , gaus);
// smooth();
// }
function setup() {
createCanvas(windowWidth, windowHeight);
background(255);
}
function draw() {
// Get a gaussian random number w/ mean of 0 and standard deviation of 1.0
var xloc = randomGaussian();
var sd = 60; // Define a standard deviation
var mean = width/2; // Define a mean value (middle of the screen along the x-axis)
xloc = ( xloc * sd ) + mean; // Scale the gaussian random number by standard deviation and mean
fill(0, 10);
noStroke();
//ellipse(xloc, height/2, 16, 16); // Draw an ellipse at our "normal" random position
var rgauss = randomGaussian(width/2, 200);
//print(rgauss);
print(width/2);
if(rgauss < 1080 || rgauss > 1480)
{
//Small dots
ellipse(rgauss,height/2, 10, 10);
}
else
{
// Big dots
ellipse(rgauss,height/2, 16, 16);
}
}