xxxxxxxxxx
30
let d, od, i;
function setup() {
createCanvas(1000 , 1000);
d = 100;
od = 300;
}
function draw() {
background(255);
stroke(0);
push();
translate(width / 2, height / 2);
for (i = 0; i < 360; i++) {
if (i % 10 == 0) strokeWeight(1);
else if (i % 5 == 0) strokeWeight(1);
else strokeWeight(0.5);
line(d * sin(2 * PI * i / 360), d * cos(2 * PI * i / 360), 0.95 * od * sin(2 * PI * i / 360), 0.95 * od * cos(2 * PI * i / 360));
if (i % 10 == 0) {
push();
translate(od * sin(2 * PI * i / 360), od * cos(2 * PI * i / 360));
textAlign(CENTER, CENTER);
strokeWeight(0.2);
text(i, 0, 0);
pop();
}
}
pop();
}