Home▸Physics & Mechanics▸Binary Star System

Binary Star System (2D)

A 2D top-down companion: a real velocity-Verlet two-body gravity integration traces each star's true elliptical path around the shared barycenter as you change mass ratio, separation and eccentricity.

Physics & Mechanics2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-3d-binary-star-system ↗ Open standalone

Most stars in the galaxy are not alone: more than half of Sun-like stars belong to a binary or multiple system, two or more stars bound by mutual gravity and orbiting a shared centre of mass. This 2D top-down companion integrates the real two-body gravitational equations of motion frame by frame with a velocity-Verlet scheme, rather than tracing a pre-computed ellipse, so changing the mass ratio, separation or eccentricity genuinely reshapes the physics: a heavier star always sweeps a tighter loop around the barycenter than its lighter companion, in exact inverse proportion to their masses, and a higher eccentricity stretches both loops into narrow ellipses while the stars swing rapidly through periapsis and linger near apoapsis, exactly as Kepler's second law predicts. It is the flat, physically-verified sibling of the site's interactive 3D double-star system.

⚙ Under the hood

A 2D top-down companion: a real velocity-Verlet two-body gravity integration traces each star's true elliptical path around the shared barycenter as you change mass ratio, separation and eccentricity.

binary startwo-body problemorbital mechanicsbarycenterkepler's laws2d

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)