Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import datetime
- launch = datetime.date(1977, 9 , 5)
- ejup = 1.0921 # Synodic period of Earth-Jupiter
- jsat = 19.8584 # Synodic period of Jupiter-Saturn
- i = 1 # synodic year earth-jupiter counter
- tol = 15 # tolerance in days
- while True:
- d1 = datetime.timedelta(days=365.242*ejup*i) # Time of the E-J synodic period
- j = round(ejup*i / jsat) # Nearest J-S synodic period
- d2 = datetime.timedelta(days=365.242*jsat*j) # Time of the J-S synodic period
- # Difference (in days) between the two synodic periods
- dif = abs((d1.total_seconds() - d2.total_seconds()) / 60.0 / 60.0 / 24.0)
- if dif <= tol:
- print("Found matching launch date!")
- print(launch + d1)
- print("Dif:", dif)
- break
- i += 1
- if not i%1000:
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement