xxxxxxxxxx
let circleLoc = [];
const NUM = 128;
let angle, velocity, radius;
function setup() {
createCanvas(windowWidth, windowHeight);
for (let i = 0; i < NUM; i++) {
circleLoc[i] = createVector(0, 0);
}
angle = createVector(0, 0);
velocity = createVector(2.0, 3.3);
radius = height / 4.0;
background(0);
}
function draw() {
background(0, 63);
noFill();
stroke(31, 127, 255);
translate(width / 2, height / 2);
for (let i = 0; i < NUM; i++) {
circleLoc[i].x = cos(radians(angle.x) / NUM * (i + 1)) * radius;
circleLoc[i].y = sin(radians(angle.y) / NUM * (i + 1)) * radius;
let diameter = map(i, 0, NUM, width / 100.0, width / 8.0);
circle(circleLoc[i].x, circleLoc[i].y, diameter);
}
angle.add(velocity);
}