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