Created
October 26, 2024 19:03
-
-
Save rdlugosz/cabab4d0129c34e27c952deb521e3cc8 to your computer and use it in GitHub Desktop.
Simhub formula to calculate the number of degrees to rotate a watchface second hand, with 8 beats per second
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let date = new Date() | |
let sec = date.getSeconds() | |
let mil = date.getMilliseconds() | |
let deg = (sec / 60) * 360 - 90 | |
let fractionalSecond = Math.round(mil / 1000 * 8) / 8 // Common Rolex 8 ticks per sec | |
let fracDeg = fractionalSecond * 6 // 6 degrees between seconds | |
return deg + fracDeg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment