my-nature-of-code/gaussian_distribution/gaussian_distribution.pde
2017-09-03 16:40:02 +02:00

20 lines
479 B
Plaintext

void setup() {
size(640, 360);
background(255);
}
void draw() {
float x_location = randomGaussian();
float random_green_colour = random(0, 255);
float random_red_colour = random(0, 255);
float random_blue_colour = random(0, 255);
float sd = 60;
float mean = width/2;
x_location = ( x_location * sd ) + mean;
color c = color(random_green_colour, random_red_colour, random_blue_colour);
fill(c, 10);
noStroke();
ellipse(x_location, height/2, 16, 16);
}