Skip to content

Instantly share code, notes, and snippets.

@carloscarvallo
Created November 2, 2022 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carloscarvallo/e03a30035bf6b4d85d58ead69b4fcd38 to your computer and use it in GitHub Desktop.
Save carloscarvallo/e03a30035bf6b4d85d58ead69b4fcd38 to your computer and use it in GitHub Desktop.
Solution for Clock Angles
function calculate(h, m) {
let minuteDegree = m * 6;
let hourDegree = h * 30 + (30 * m) / 60;
return Math.abs(hourDegree - minuteDegree);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment