Add gaussian distribution

This commit is contained in:
Yannick Francois 2017-09-03 16:40:02 +02:00
parent 3055dbd0a2
commit 4245bc4dec

View File

@ -0,0 +1,20 @@
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);
}