My attemt at simulating gravity via classical mechanics and specificly Newtons law of universal gravitation:
Earth and Moon 28,6 Days
This Gif shows a simulated trip for the moon (orange) around the earth (blue). The red vector shows the direction of the applied force while the blue one shows the velocity of the object.
Config : Frames: 686, Seconds/Frame: 3600 (1 Hour / Frame),
Objects:
Data | Earth | Moon |
---|---|---|
X-Pos | 0 | 0 |
Y-Pos | 0 | 369671000 |
X-Vel | 0 | 1082 |
Y-Vel | 0 | 0 |
Mass | 6 * 10 ** 24 | 7.3 * 10 ** 22 |
- Clone this repo
- Make sure your python env has the required dependencies, otherwise install with pip install
- imageio
- typing
- matplotlib
- Configure setting and indata in Simulation.py
- Run Simulation.py with: Python3 Simulation.py
- Simulation gif should be in the "Gifs" folder
This project was made to practice object oriented programming in Python.