xxxxxxxxxx
20
let r = 150;
let theta = 0;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
let x = r*cos(theta);
let y = r*sin(theta);
translate(width/2, height/2);
line(0, 0, x, y);
ellipse(x, y, 20, 20);
theta = theta + 0.01;
}