xxxxxxxxxx
function setup() {
createCanvas(300, 300);
background(255, 255, 255);
angleMode(DEGREES);
frameRate(15);
}
const r1 = 75;
const r2 = 25;
let angle = 0;
function draw() {
// if(angle === 0) {
// background(255, 255, 255);
// }
//background(255, 255, 255);
translate(width / 2, height / 2);
let {x, y} = polarToCartesian(r1, angle)
//circle(x, y, r2 * 2);
circle(mouseX-width/2,mouseY-height/2,20);
angle = (angle + 10) % 360;
}
function polarToCartesian(r, theta) {
return {
x: r * cos(theta),
y: r * sin(theta)
};
}