This Python code simulates the real-time orbitation of planets around the sun using orbital elements. It calculates the X, Y, Z positions of the planets and their distances from the sun, and visualizes the results.
-
Real-time simulation: Calculate the real-time positions of planets based on their orbital elements.
-
Visualizations: 3D graphical visualization of the solar system and graphs showing the distance of planets from the sun over time.
-
Interactive Controls: Choose which planets to simulate and whether to display distance graphs.
-
Python 3
-
VPython library for 3D visualization
-
datetime module for handling dates and times
-
The first four planets: simulate Mercury, Venus, Earth, and Mars.
-
The last five planets: simulate Jupiter, Saturn, Uranus, Neptune, and Pluto.
-
All: simulates all nine planets.
Choose whether to display graphs of the distance of each planet from the sun over time.
- planet_fun(time): Calculates the planets' coordinates.
