xxxxxxxxxx
45
let t = 1;
let r = 190;
let a = 0;
let posX;
function setup() {
createCanvas(400, 400);
background(220);
posX = 0
// frameRate(5)
}
function draw() {
background(220, 3);
translate(posX, height/2)
rotate(a)
let x = cos(t) * r;
let y = sin(t) * r;
// circle(0, 0, r*2)k
stroke(0)
fill(255)
circle(x, y, r/8)
noFill()
stroke(255, 0, 0)
// circle(0, 0, r*2)
// line(0, 0, x, 0);
// line(0, 0, 0, y)
// line(x, 0, 0, y)
// line(x, y, 0, y)
// line(x, y, x, 0)
// line(0, 0, x, y)
t += 0.01;
r -= 0.367;
// a += 0.5
posX += 0.5;
if (r < -190) r = 190;
if (posX > width) posX = 0
}