xxxxxxxxxx
33
let margin;
function setup() {
createCanvas(windowWidth, windowHeight);
noStroke();
fill('#fffff1');
margin = height/10
}
function draw() {
background(0);
let numCircles = 20;
let radius = margin;
let spacing = TWO_PI / numCircles;
translate(width / 2, height / 2);
for (let i = 0; i < numCircles; i++) {
let offset = i * margin / 20;
let wave = sin(radians(frameCount*4) + offset);
let waveMapped = map(wave, -1, 1, -margin/5, margin/5)
let angle = i * spacing;
let x = (radius + waveMapped) * cos(angle);
let y = (radius + waveMapped) * sin(angle);
circle(x, y, margin/5);
}
// if(frameCount == 1) saveGif('polarSin', 3)
}