[Solved] What is the explanation behind the math to set a clock pointers to desired degrees?
[ad_1] let hr = date.getHours(); let min = date.getMinutes(); let sec = date.getSeconds(); let hrPosition = hr*360/12 + ((min * 360/60)/12) ; let minPosition = (min * 360/60) + (sec* 360/60)/60; let secPosition = sec * 360/60; hrPosition -> full circle has 360 degrees, on clock it’s 12 hours, so 1 hour is 360/12 = … Read more