xxxxxxxxxx
46
let hr;
let mn;
let sc;
function setup() {
createCanvas(400, 400);
angleMode(DEGREES);
}
function draw() {
background(0);
translate(200,200);
rotate(-90);
hr = hour();
sc = second();
mn = minute();
stroke(255);
noFill();
strokeWeight(4);
let end1 = map(hr % 12, 0, 12, 0, 360);
arc(0, 0, 300, 300, 0, end1);
let end2 = map(mn, 0, 60, 0, 360);
arc(0, 0, 280, 280, 0, end2);
let end3 = map(sc, 0, 60, 0, 360);
arc(0, 0, 260, 260, 0, end3);
push();
rotate(end3);
line(0,0,100,0);
pop();
push();
rotate(end2);
line(0,0,80,0);
pop();
push();
rotate(end1);
line(0,0,60,0);
pop();
}