Gravity & Orbits Sandbox
Drag planets, set their velocity and watch gravity build orbits, slingshots and collisions.
Press on empty space and drag to launch a planet (the arrow is its velocity). Drag existing planets to move them.
About the Gravity & Orbits Sandbox
Free n-body gravity sandbox. Add planets and moons, drag to set their launch velocity, change the star's mass and watch orbits, slingshots and collisions unfold. Built for earth & space, the gravity & orbits sandbox runs instantly in your browser: change a setting or drag an object and the result updates at once, so you learn by trying things out rather than only reading about them.
Drag planets, set their velocity and watch gravity build orbits, slingshots and collisions. Use it to explore earth & space ideas at your own pace, then check what you found against the key ideas further down this page.
How to use the Gravity & Orbits Sandbox
- Use the controls to change Star mass, New planet mass, Time speed. The simulation reacts instantly.
- Pick an option such as Slow, Normal, Fast, Trails to switch modes or load an example.
- Press "Pause", "Clear planets" to start, reset or change what is happening.
- Where you see a glowing handle, object, weight or atom, drag it with your mouse or finger. Everything responds in real time.
- Watch the readouts and graphs update as you experiment, and compare what you see with the key ideas below.
Things to try
- Press Add planet and drag from it to set its velocity.
- Make a circular orbit by launching at right angles to the star.
- Add a moon around a planet.
- Increase the star mass and watch orbits shrink.
Key ideas you can learn
- Gravity is an inverse-square force: double the distance, a quarter of the pull.
- Faster launch speeds make bigger, more elongated orbits.
- Small bodies can be flung out by close passes to heavy ones (a gravity slingshot).
Where this is used in the real world
Mission planners use gravity assists to send probes to distant planets. Astronomers use the same maths to find exoplanets and to predict where asteroids will go.
Who is this simulation for?
Astronomy and earth-science students, and teachers who need a visual model to explain what is happening in the sky.
For teachers: project it on the board, let students predict what will happen, then run it together. For students: change one thing at a time and write down what changes.
Frequently asked questions
Why do planets stay in orbit?
They are constantly falling toward the star but moving sideways fast enough that they keep missing it.
What is a gravity slingshot?
When a spacecraft passes close to a moving planet, it can steal a little of the planet's orbital energy and leave much faster. Space missions use this to save fuel.
Is the Gravity & Orbits Sandbox free to use?
Yes. It is completely free, with no signup, no download and no ads inside the simulation. It runs in your web browser.
Does the Gravity & Orbits Sandbox work on a phone or tablet?
Yes. It uses touch as well as the mouse, so you can drag objects with your finger. A larger screen makes the controls easier to see.