Overview
Orbit Simulator lets users place celestial bodies in a 2D space and observe gravitational interactions in real time. It serves as both an educational tool and a sandbox for experimenting with orbital mechanics.
Key Features
- N-body gravitational simulation with configurable mass and velocity
- Trajectory prediction lines showing future orbital paths
- Time controls for slow motion, pause, and fast forward
- Preset scenarios: Earth-Moon, solar system, binary stars
- Zoom and pan with mouse or touch gestures
Technical Highlights
Physics calculations run in a Web Worker to keep the UI thread responsive during complex N-body simulations. The Verlet integration method provides stable orbits even at larger time steps.
Trajectory prediction uses a separate simulation instance running ahead of real time, drawing projected paths as dotted lines. The renderer batches draw calls and uses offscreen canvases for static background elements.
Comments