const s = (p) => { const w = 400; const h = 400; // Center coordinates const x0 = 200; const y0 = 200; // Radius const r = 150; var angle = 0; p.setup = () => { p.createCanvas(w, h); p.stroke(0, 0, 0, 10); p.background(225); }; p.draw = () => { var a, b = 0; var numPoints = 10; for(var i = 0; i <= numPoints; i++) { // Pillow var x = x0 + r * Math.cos(2 * Math.PI * i / numPoints - angle); var y = y0 + r * Math.sin(2 * Math.PI * i / numPoints + angle); if (i != 0) p.line(a, b, x, y); a = x; b = y; } angle += 1; }; }; let myp5 = new p5(s);