float x, y;
float a, b, c, d;
float scale = 150.0;
void setup(){
size(640, 640);
frameRate(360);
fill(0, 128);
noStroke();
mousePressed();
}
void mousePressed(){
background(255);
x = random(-0.1, 0.1);
y = random(-0.1, 0.1);
a = random(-2.5, 2.5);
b = random(-2.5, 2.5);
c = random(-2.5, 2.5);
d = random(-2.5, 2.5);
}
void draw(){
for(int i = 0; i < 10000; i++){
float nx = sin(a * y) - cos(b * x);
float ny = sin(c * x) - cos(d * y);
translate(width / 2, height / 2);
rect(x * scale, y * scale, 1, 1);
x = nx;
y = ny;
}
}