Answer the question
In order to leave comments, you need to log in
How to calculate the period of parade of planets?
Is there any formula? In which direction to dig, if the periods of revolution of the planets are given?
Answer the question
In order to leave comments, you need to log in
The visible parade of planets is called a planetary configuration, when the five bright planets of the solar system (Mercury, Venus, Mars, Jupiter and Saturn) in their movement across the sky come close to each other and become visible at the same time in a small sector (10 - 40 degrees ) sky.
from itertools import count
n = 12 # число секторов, мы же взяли сектор в 30°
year = 365.256363004
periods = (
87.969, # Меркурий
224.698, # Венера
686.98, # Марс
4332.589, # Юпитер
10759.22 # Сатурн
)
speeds = [n / p for p in periods] # угловые скорости планет, сектор/день
for t in count(40): # стартанём не сразу, а погодя, чтобы планеты разошлись,
# за 40 дней меркурий убежит почти на 180°
mercury, *others = (int(t * speed) % n for speed in speeds)
if all(planet == mercury for planet in others):
y = int(t / year)
print(f'{y} лет {round(t - y * year)} дней')
break
Exhaust - 377 years 212 days. n = 360. # просто 360°
occupied = 45. # размер сектора, в который должны впихнуться планеты
year = 365.256363004
periods = (
87.969, # Меркурий
224.698, # Венера
year, # Земля
686.98, # Марс
4332.589, # Юпитер
10759.22, # Сатурн
60190.03, # Нептун
# 90553.02 # Плутон # всё равно он не планета
)
speeds = [n / p for p in periods] # угловые скорости планет
t = t0 = 0 # текущая дата, дата 'нулевого' парада
for _ in range(32): # число выводимых парадов
while True:
t += 1
if t - t0 < 43:
continue # пусть планеты разойдутся, за 43 дня меркурий убежит на 180°
def width():
planets = sorted((t * speed) % n for speed in speeds)
a, max_free_angle = planets[-1] - n, 0.
for b in planets:
if max_free_angle < b - a:
max_free_angle = b - a
a = b
return 360. - max_free_angle
if width() < occupied: # подкараулим день, когда сектор будет минимальным
u = v = width()
while u >= v:
t += 1
u, v = v, width()
print(f'через {round((t - t0 - 1) / year):>4} лет '
f'планеты соберутся в секторе {round(u)}°')
t0 = t - 1
break
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question