Last active
May 16, 2020 13:21
-
-
Save cxmeel/62c73c62977335f33b74cd43d938d047 to your computer and use it in GitHub Desktop.
This file contains 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
local function timeToDegrees(hours, minutes, inRadians) | |
hours = type(hours) == "number" and hours or 0 | |
minutes = type(minutes) == "number" and minutes or 0 | |
local timeDegrees = { | |
hours = (hours / 12) * 360, | |
minutes = (minutes / 60) * 360 | |
} | |
if (inRadians) then | |
timeDegrees.hours = math.rad(timeDegrees.hours) | |
timeDegrees.minutes = math.rad(timeDegrees.minutes) | |
end | |
return timeDegrees | |
end | |
return timeToDegrees |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment