def DMStoDD(degree, minutes, seconds): dd = abs(degree) + abs(minutes)/60 + abs(seconds)/3600 if degree > 0: return dd else: return -dd def DDtoDMS(dd): degree = int(abs(dd)) minutes = int((abs(dd) - degree) * 60) seconds = int((((abs(dd) - degree) * 60) - minutes) * 60) if dd > 0: return tuple((degree, minutes, seconds)) else: return tuple((-degree, minutes, seconds)) print(DMStoDD(-30, 30, 00))
Get Answers For Free
Most questions answered within 1 hours.