xxxxxxxxxx
29
let secondR = 150;
let minuteR = 100;
let hourR = 70;
function setup() {
createCanvas(400, 400);
frameRate(1);
angleMode(DEGREES);
}
function draw() {
background(0);
translate(200, 200);
let h = hour();
let m = minute();
let s = second();
let sAngle = map(s, 0, 60, 0, 360) - 90;
let secondPoint = {
x: secondR * cos(sAngle),
y: secondR * sin(sAngle)
};
stroke(255);
strokeWeight(3);
line(0, 0, secondPoint.x, secondPoint.y);
}