Created
September 11, 2021 15:41
-
-
Save AlexMorgan3817/f227f9acef1fc90e6fb0944fb189b9f1 to your computer and use it in GitHub Desktop.
Converts real degrees to list of decimal degrees, minutes, seconds
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
def DegreeToList(degree): | |
dot = [] | |
seconds = degree * 3600 | |
hours = seconds // 3600 | |
seconds -= hours*3600 | |
minutes = seconds // 60 | |
seconds -= minutes * 60 | |
seconds = round(seconds) | |
minutes = round(minutes) | |
hours = round(hours) | |
dot.append(hours) | |
if(minutes or seconds): | |
dot.append(minutes) | |
if(seconds): | |
dot.append(seconds) | |
return dot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment