Both orbits start from the exact same position and velocity. One is integrated under pure Newtonian gravity; the other under Newtonian gravity plus a general-relativistic correction term. Both use the same RK4 integrator, stepped side by side every frame, so the only difference between the two trajectories is the force law itself.
Newtonian force: F/m = -GM/r²
GR-corrected: F/m = -GM/r² · [1 + k·L²/(c²r²)]
Mercury's real per-orbit shift: Δφ = 6πGM / (c²·a(1-e²))
The 1/r⁴ correction term is what breaks the closure of the Newtonian ellipse: because it strengthens faster than 1/r² as the planet swings through perihelion, it torques the orbit's major axis forward a little on every pass. Since the real effect is a fraction of an arcsecond per orbit for Mercury, the GR correction strength slider (k, the coefficient above) exaggerates it so the precession is visible within a handful of orbits — at 0 the GR orbit is exactly the Newtonian ellipse.
- GR correction strength — multiplies the 1/r⁴ relativistic term; 0 disables it and the two orbits become identical.
- Eccentricity — how elongated the shared starting ellipse is (0 = circle). The (1-e²) in the formula above means higher eccentricity gives a larger precession per orbit at fixed a.
- Semi-major axis a — the orbit's mean size. A smaller a puts the planet deeper in the star's field on every pass, which is exactly the 1/a scaling in the formula above — shrink the orbit and precession per orbit grows.
- Central mass — scales GM, which sets orbital speed, period, and (through the same formula) precession strength.
- Precession is detected live on the GR trajectory: each time it passes perihelion, the simulator records the angle and reports how far the ellipse's axis has rotated since the previous pass. The Newtonian trajectory is tracked the same way as a sanity check — it should stay near zero.