PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

Related simulators

Continue with similar topics in this category — or all 27 in Gravity & Orbits.

View category →
NewSchool

Space Elevator Tether

Launch Simulator

1D tension vs height; peak near GEO (normalized model).

School

Escape Velocity

Launch Simulator

Launch from different planets and see trajectory results.

NewSchool

Gravity-Assist Fly-By

Launch Simulator

Planet frame |u_out|=|u_in| rotated by δ; star frame v = V + u — Δ|v| from moving planet.

NewSchool

Hohmann Transfer

Launch Simulator

Coplanar circles r₁,r₂; transfer ellipse; Δv₁, Δv₂ from vis-viva.

NewUniversity / research

Roche Limit

Launch Simulator

Fluid d ≈ 2.456 R_p (ρ_p/ρ_s)^(1/3); vs orbit distance.

NewUniversity / research

Three-Body Figure-Eight

Launch Simulator

Equal masses: Chenciner–Montgomery choreography in 2D (RK4, periodic orbit).

PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Gravity & Orbits/Gravity Sandbox

Gravity Sandbox

Place masses and watch N-body gravitational interactions unfold.

Physics

120
28 px
1 ×

Interaction

80
28 pts

Shortcuts

  • •Space / Enter — pause or resume
  • •R — clear all bodies

Measured values

Bodies0
Max bodies48
Trail memory28pts

About this model

N-body gravity: place masses and watch mutual attraction evolve. Good for intuition about Lagrange-like balance, slingshots, and instability in multi-body systems.

Who it's for: Astrophysics curious learners; conceptual N-body play (not a mission planner).

Key terms

  • N-body
  • gravity
  • superposition
  • orbital mechanics

How it works

A playful N-body sandbox: every mass attracts every other mass with Newton’s law, softened slightly (ε) so close encounters stay numerically stable. Drag a body to pin it; release to let gravity take over again. When two bodies overlap, they merge — mass and momentum combine. Start with the built-in binary or clear and place your own stars. This is a qualitative toy, not a solar-system ephemeris.

Key equations

aᵢ = Σⱼ G mⱼ (rⱼ − rᵢ) / (|rⱼ − rᵢ|² + ε²)^{3/2}
Velocity Verlet integration (symplectic-ish)

Frequently asked questions

What does softening ε do?
Close encounters make 1/r² forces blow up and can crash the integrator. Softening replaces the denominator with (|r|² + ε²)^{3/2}, so gravity stays finite at small separations. Larger ε is more stable but less Newtonian up close; smaller ε is sharper but riskier numerically.
Do merges conserve energy?
Overlapping bodies combine with mass-weighted position and velocity, so mass and momentum are conserved, but the merger is inelastic: orbital kinetic energy is lost. Softening also changes the potential, and finite timesteps add small drift — treat energy as qualitative, not an ephemeris-grade invariant.
Can I use this as a solar-system ephemeris or mission planner?
No. This is a 2D qualitative sandbox for intuition about mutual gravity, chaos, and flybys. Real mission design needs high-fidelity ephemerides, many perturbing bodies, relativity and non-gravitational forces, and carefully controlled integrators — none of which this toy provides.