Skip to content

Instantly share code, notes, and snippets.

@AlexMorgan3817
Created September 11, 2021 15:41
Show Gist options
  • Save AlexMorgan3817/f227f9acef1fc90e6fb0944fb189b9f1 to your computer and use it in GitHub Desktop.
Save AlexMorgan3817/f227f9acef1fc90e6fb0944fb189b9f1 to your computer and use it in GitHub Desktop.
Converts real degrees to list of decimal degrees, minutes, seconds
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