xxxxxxxxxx
27
let circleX;
let circleY;
let circleSize;
function setup() {
createCanvas(800, 600);
circleX = width / 2;
circleY = height / 2;
}
function draw() {
background(220);
// Update circle position based on mouseX
circleX = mouseX;
circleY = height / 2;
// Update circle size with an exponential relationship
circleSize = map(circleX, 0, width, 50, 300);
circleSize = pow(circleSize, 0.5); // Amplify the effect
// Draw circle
fill(255, 0, 0);
noStroke();
ellipse(circleX, circleY, circleSize, circleSize);
}