All collisions are elastic and conserve kenetic energy and momentum. Particles deflect off of the walls of the screen accurately. Increasing the raddius of a particle also increases its mass (proportional to the radius squared).
-
Run the evolve.py file.
-
Set the n variable to the number of bodies you want to simulate.
-
Set the act.h variable to the simulation step size.
-
Set the screen_width, screen_height variables to your resolution.
-
Pressing the w/s keys (while mousing over circle) increases/decreases the circle's radius.
-
Pressing the a/d keys (while mousing over circle) decreases/increases the circle's speed.
-
Pressing the up arrow/down arrow keys increases/decreases all of the circles' radii.
-
Pressing the left arrow/right arrow keys decreases/increases all of the circles' speeds.
-
Pressing the q/e keys decreases/increases the time-step size of the simulation.