## 3-Body Problem ##
This one simulates the socalled three body problem, which describes the unpredictability (due to chaos) of newtons laws being applied to three bodies, which are strongly sensitive to the initial starting conditions. The only external library it uses is pygame, all others are built into python itself.
## Running ##
-
Make sure you have a new-ish version of pygame installed.
$ pip install pygame
-
Run the program. This will open up a new pygame window simulating newtons laws on three bodies. The initial conditions are defined in the reset function in main.py.
$ python main.py
-
Try different starting conditions. You can find them in the reset function in main.py.
def reset():
global objects
objects = []
# try changing some of these numbers
# mass,position,velocity
objects.append(Object(60, (-25, 0), (0, -1)))
objects.append(Object(100, (20, 0), (0, 0)))
objects.append(Object(80, (0, 30), (3, 0)))
-
Hack it. The project is licensed under the MIT License and you can find a copy in the LICENSE file.
-
Contribute. Have made great new changes? Feel free to PR.
© 2024 Lucas Birkert - All Rights Reserved