xxxxxxxxxx
33
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
for (let i = 0; i < 5; i++) {
circle(200 + cos((i * TAU) / 5) * 100, 200 + sin((i * TAU) / 5) * 100, 50);
}
/*
// adapt to different number of object
nb = 12
for (let i = 0; i < nb; i++) {
circle(
200 + cos((i * TAU) / nb) * 100,
200 + sin((i * TAU) / nb) * 100,
50);
}
*/
/*
// Animate
nb = 7
for (let i = 0; i < nb; i++) {
circle(
200 + cos((i * TAU + frameCount*0.1) / nb) * 100,
200 + sin((i * TAU + frameCount*0.1) / nb) * 100,
50);
}
*/
}