Press keys 0-9, Q, W, E, Z, X, C to load scenarios.
Press 'H' to toggle HUD, 'R' to reset.
Readme
How to Use
Click the Run button to load the Python program.
Press the number keys at the top of the keyboard and the Q, W, E, Z, X keys to load a scenario.
"Size" only increases the visual size of an object so it's easier to see. It doesn't change the gravity, and it doesn't cause any collisions even if they now appear to be overlapping.
"Speed" increases the speed of the simulation. Non-linear increments.
Keyboard Shortcut Keys
H toggle on/off the HUD (buttons and scale).
R resets the current scenario.
F toggles the blur effect, which may be seen if the speed is increased.
Scenarios
Scenario 0 is an object falling to Earth
Scenario 1 is an object with some initial velocity to take off, but it's pulled down
Scenario 2 is the same as scenario 1, but with more velocity and it is zoomed out to show the curvature of the Earth
Scenario 3 is an object with enough initial velocity to take off and it stays in orbit
Scenario 4 is the moon orbiting the Earth
Scenario 5 shows two objeects of the same mass orbiting each other
Scenario 6 is an orbit being created with no starting velocity
Scenario 7 shows three objects orbiting each other for some time before colliding
Scenario 8 shows the inner solar system
Scenario 9 shows all the planets in the solar system orbiting the Sun
Scenario 10 (Q) shows the Sun orbiting the Super Massive Black Hole
Scenario 11 (W) shows the Earth and the Moon, plus 10 randomly placed objects moving at random velocities
Scenario 12 (E) shows the Earth and the Moon, and a counter-clockwise moon on crash course with regular moon
Scenario 13 (Z) is the same as Scenario 6, but there are 60 randomly placed objects. The objects that remain in orbit usually all go in the same direction.
Scenario 14 (X) is tracking the Earth, so that is giving an Earth centric perspective which will make the other planets and the sun appear to be orbitting the Earth.
Final Notes
All collisions are perfectly inelastic.
There is something weird with how long it takes for real-world objects to orbit in some scenarios. I don't know if that is the fault of my math or if there needs to be a specific distance or speed for the orbitting objects.
- Created by Khalid Shahin Spring 2014 Automatically converted to HTML/CSS/JavaScript in 2025