A small, interactive exploration of gravity and time, built by RocketShift. Rotate a three-dimensional lattice, follow orbiting bodies, and compare colored clocks near a central mass.
A self-contained educational browser experience. Open index.html directly in a modern browser, or run python3 -m http.server 8765 from this directory and visit http://localhost:8765. No libraries, trackers, network requests, API keys, installations, or build step are required. Share the single HTML file to run offline. The homepage link is optional; the simulation itself makes no network requests.
Drag (touch or mouse) to orbit; scroll or use +/− to zoom. With canvas focused, arrow keys rotate. Pause freezes clocks and orbits; camera remains interactive. Reset returns the complete default state. Mass and preset changes restart the clocks; grid exaggeration and lattice brightness do not. Star Brightness spans 0–100%, adjusting surface illumination and halo intensity, never transparency; 0% shows an opaque, shaded planet-like sphere with no emitted glow. Its gravity and clock rates are unchanged. Reset restores 100%. The Lattice Brightness slider spans 0–500% and affects only the lattice, while the taller viewing area leaves explanations below for scrolling. Simulated time advances at 60 seconds per real second and pauses while the browser is hidden.
Static-clock lapse is exactly sqrt(1-rs/r) in Schwarzschild spacetime for an ideal nonrotating spherical central source, relative to a reference clock at infinity. Radius is measured in units of the central body's fixed radius R. Default compactness rs/R = 0.5; Sun-like = 0.00000424. Mass strength ranges 0.3–1.3. Thus even at maximum mass rs/R = 0.65 < 1, and all probes (1.45, 3, 5.6 R) remain outside the horizon and stellar surface. This is not an orbital-clock calculation.
The three-dimensional lattice is an explicitly illustrative deformation, not a numerical GR solution or literal material being pulled inward. Its appearance is not a physical distance metric. Orbiting planets use fixed-step velocity Verlet integration of central Newtonian gravity, with qualitative local dents only. They are independent test particles, not mutually interacting bodies. Orbital units are illustrative and separate from the static-clock seconds; compact-star orbits are not physical GR predictions. Their mass and velocity do not affect the calculated probe clocks. Coordinate/optical effects, light propagation delay, frame dragging, kinetic time dilation, and full multi-body spacetime are excluded. The central stellar radius and grid visual deformation remain distinct.
Far-away reference is represented only by a clock card, not a finite spatial marker. All three colored probes are held at fixed radii, not attached to planets. Seconds shown by each clock are local elapsed proper time under the stated model. Weak-field rates use six decimals to make the tiny difference explicit.
The numerical check requires Node.js but no installed packages:
npm testFor optional Chromium browser checks (Node.js 18 or newer):
npm install
npx playwright install chromium
npm run test:browserThe browser check resolves this directory portably and creates desktop/mobile screenshots under artifacts/ (ignored by Git). Package installation and browser download need internet access; neither is required to run the simulation. On Linux, Playwright may additionally need browser system dependencies (npx playwright install --with-deps chromium).
node verify.mjs checks the extracted real production clock-rate function and model domain. Browser smoke tests should verify canvas output, pointer/camera rotation, pause/resume, reset, presets, responsive controls, and no overflow on mobile. A physical WebGL engine is unnecessary: canvas uses perspective projection and does not require GPU library support.
Suggestions, accessibility improvements, and clearer educational explanations are welcome. Keep the distinction between calculated clock rates and illustrative graphics explicit. Please include numerical checks for model changes and browser checks for interaction/layout changes. This version does not implement a three-body solver or a camera that travels among the bodies.
MIT, copyright 2026 Jason Armstrong. You may reuse, modify, and distribute the code, including commercially, while retaining the copyright and license notice. The license includes no warranty. Attribution to RocketShift is appreciated; the license does not require a visible promotional link in your interface.
Circular, elliptical and escape starts set initial velocity at the current mass. Mass changes preserve each planet’s position and velocity and change future acceleration; energy is not conserved across an externally changed mass. Restart orbits resets only the planets/trails; Reset restores all defaults. Impact with the radius-1 surface stops a planet, while departure beyond 60 R removes it. Both are reported in the live status. Trails retain at most 500 points per planet. The grid extent spans 6–18 R with a fixed 147 lines/49 samples per line and near-plane clipping.
The Solar System-inspired preset adds all eight named planets in order, with compressed orbital spacing and exaggerated radii/colors. Distances, masses and orbital period ratios are not a physical Solar System scale model; outer planets move more slowly according to their displayed radius. No moons, mutual gravity or general-relativistic orbital correction is included.