Skip to content

Instantly share code, notes, and snippets.

@p5info
Created February 25, 2013 05:28
Show Gist options
  • Save p5info/5027951 to your computer and use it in GitHub Desktop.
Save p5info/5027951 to your computer and use it in GitHub Desktop.
Processing2.0b8 new function sample(lite) Original version is https://gist.github.com/p5info/68f026142d8ada895280
final int RATIO = 10;
float x, y;
void setup() {
clear();//more than 2.0b8 (If less than 2.0b7 background(0, 0, 0, 0))
size(200, 200);
stroke(255);
frameRate(1000);
}
void draw() {
//randomGaussian()version
x =width/2+ randomGaussian()*RATIO;//more than 2.0b8
y =height/2+ randomGaussian()*RATIO;//more than 2.0b8
////random() version
// x =width/2+ random(-1,1)*RATIO;
// y =height/2+ random(-1,1)*RATIO;
point(x, y);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment