xxxxxxxxxx
26
let r = 50;
const r_offset = 100;
const r_depth = 50;
let theta = 0;
let theta_a = 0.1;
let phi = 0;
let phi_a = 0.6;
function setup() {
createCanvas(400, 400);
background(220);
}
function draw() {
translate(width/2, height/2);
const x = r*cos(theta);
const y = r*sin(theta);
ellipse(x, y, 10, 10);
r = r_offset + r_depth*sin(phi);
theta += theta_a;
phi += phi_a;
}