← All tools · 한국어

Gravity sandbox

Drag to throw a planet. The drag is its speed. Bodies that touch merge. Now try to make one orbit — properly, more than twice.

0 bodies

Press and drag anywhere to fling a new body: the drag is its starting velocity. Bodies that touch merge and keep momentum. Try to put one into a stable orbit around the star — it is harder than it looks, which is why rocket science is a phrase. Three full laps earn a badge.

What to try

  • Solar system — three planets on circular orbits. Throw a fourth one in and see who survives.
  • Binary stars — two equal stars circling their common centre. Add a planet and find a stable place for it (hint: far out, or very close to one star).
  • Three-body — three equal masses. There is no formula for this; it has to be simulated, and it usually ends with one body flung away.

Softened Newtonian gravity, leapfrog-ish integration, momentum-conserving merges. Bodies that drift far off screen are removed.

How to make an orbit

  1. Start from "Little solar system" or clear the sky and keep only a heavy star.
  2. Press about 150 px from the star and drag sideways — at right angles to the line between your finger and the star. A drag of roughly 100 px is a good first guess at that distance.
  3. Too short a drag and the planet falls into the star; too long and it escapes. Adjust and throw again.
  4. Three full laps around the heaviest body earn the badge; the label above the planet counts the laps.

The physics

Every body pulls every other with Newton's inverse-square law, softened slightly at very short range so close passes do not explode numerically. Two bodies that touch merge into one, keeping their combined mass and momentum. For a circular orbit the speed must be the square root of G·M divided by the distance; about 1.4 times that and the planet escapes for good. Anything that drifts far off screen is removed.

Questions

Why does the three-body preset fall apart? There is no general formula for three bodies; tiny differences grow, and usually one body is flung away while the other two pair up.

What does mass change? Heavier bodies pull harder and are pushed less; a massive throw can capture or swallow the star itself.