xxxxxxxxxx
let numCirclesOuter = 12;
let numCirclesInner = 6;
let circleRadiusOuter = 100;
let circleRadiusInner = 40;
let angle = 0;
function setup() {
createCanvas(400, 400);
angleMode(DEGREES);
}
function draw() {
background(220);
translate(width / 2, height / 2);
for (let i = 0; i < numCirclesOuter; i++) {
let x = circleRadiusOuter * cos(angle + i * 360 / numCirclesOuter);
let y = circleRadiusOuter * sin(angle + i * 360 / numCirclesOuter);
ellipse(x, y, 30, 30);
}
for (let i = 0; i < numCirclesInner; i++) {
let x = circleRadiusInner * cos(-angle + i * 360 / numCirclesInner);
let y = circleRadiusInner * sin(-angle + i * 360 / numCirclesInner);
ellipse(x, y, 20, 20);
}
angle += 1;
circleRadiusOuter = map(mouseX, 0, width, 50, 150);
circleRadiusInner = map(mouseY, 0, height, 20, 60);
}