xxxxxxxxxx
29
//Processing translated into p5.js
// code copied from : https://github.com/yukiy/drawCircle/blob/master/Algorithms/sincos360/drawCircle/drawCircle.pde
let radius = 150;
function drawCircle(){
for(let r=0; r<mouseX; r++){
let x = cos(radians(r))*radius + width/2-50;
let y = sin(radians(r))*radius + height/2-50;
fill(255);
stroke(0);
rect(x, y , 100, 100);
}
}
function setup() {
createCanvas(600, 600);
background(255);
smooth();
}
function draw() {
background(255);
drawCircle();
}