xxxxxxxxxx
function setup() {
createCanvas(w=720, h=w);
colorMode(HSB);
background(98);
push();
strokeWeight(1);
stroke(10, 0.25);
translate(w/2, h/2);
let a = -1.4;
let b = 1.4;
let c = 1.7;
let d = -1.4;
let draw_scale = 150;
let N = 100000;
let x = random(-1,1);
let y = random(-1,1);
for(let i=0;i<N;i++){
let dx = sin(y*a) + cos(x*b);
let dy = sin(x*c) + cos(y*d);
point(draw_scale*dx, draw_scale*dy);
x = dx;
y = dy;
}
pop();
}
//save PNG
function keyPressed() {
let name = "img_" + month() + day() + hour() + minute() + second();
save(name + ".png");
}