Skip to content
← About the project

Physics, methods & assumptions

What Orbital Sandbox calculates.

The planner turns a state vector—position and velocity—into a trajectory and a set of orbital quantities. This page describes the model behind those results, including where the model stops.

01 · Model

A point mass and a spacecraft.

The editable sandbox uses the two-body approximation: one spacecraft moves under the gravity of one central body. The body is treated as a point mass, summarized by its standard gravitational parameter μ.

d²r/dt² = − μ r / |r|³

Position is measured from the body’s center in an inertial Cartesian frame. The simulator stores kilometres and kilometres per second; time is seconds. The 3D renderer maps the same state into its scene coordinates for display, while the physics remains body-centered.

Planetary μ and radius values are kept in the project’s body catalog. Earth uses μ = 398600.4418 km³/s² and radius = 6378.137 km.

02 · Propagation

Universal variables for coast segments.

Between burns, the solver uses the universal-variable formulation of the Kepler problem. It works across elliptical, parabolic, and hyperbolic coasts without choosing a separate conic solver first.

f = 1 − χ²/r₀ · C(αχ²)
g = Δt − χ³/√μ · S(αχ²)
r(Δt) = f r₀ + g v₀

The universal anomaly χ is solved iteratively. Stumpff functions C and S handle the sign of α, where α = 2/|r₀| − |v₀|²/μ. The implementation uses a relative tolerance of 1e−12, up to 50 iterations per direct solve, and recursively subdivides difficult long steps up to a fixed depth.

Diagnostics record convergence, iterations, subdivision, energy drift, angular-momentum drift, and an explicit failure reason. A failed propagation returns no guessed state.

See representative solver checks →

03 · State → elements

Readouts come from the same state vector.

The Flight data panel derives osculating quantities from the current position r and velocity v. Specific orbital energy and angular momentum are:

ε = |v|²/2 − μ/|r|
h = r × v

Semi-major axis uses a = −μ/(2ε) for non-parabolic states. Eccentricity comes from the eccentricity vector. Periapsis and apoapsis are reported when the current conic has finite values. Period is reported only for bound states.

The Prograde and Retrograde handles add velocity along or opposite the spacecraft’s velocity immediately before the selected maneuver, including the effect of earlier burns. This direction stays fixed while editing that maneuver. Away from an apsis in an eccentric orbit, these handles change both radial and transverse components. The advanced Δv fields remain explicit RTN components. At zero speed, a direction of travel is undefined, so these two handles are unavailable; radial and normal controls remain available.

A burn changes velocity instantaneously in the local RTN frame: R = r/|r|, N = (r × v)/|r × v|, and T = N × R. Normal impulses change the orbital plane. For a radial state, the stored reference normal supplies a deterministic fallback. Circular orbits use argument of latitude; equatorial orbits use longitude conventions. Undefined angles are conventions, not measured orientations. The 3D editor accepts six Cartesian components or elliptical orbital elements; old planar links and files retain their original meaning. The ideal propellant estimate uses the rocket equation and the selected specific impulse; it is an estimate, not a fuel-system simulation.

04 · Events & failures

Boundaries are part of the result.

Flight-plan previews split coast segments at maneuver epochs and locate the first surface-impact or display-radius crossing. Playback reports a burn at its scheduled event epoch, even if an accelerated frame advances beyond it.

States are classified as bound, escape, impact, or invalid. Near-parabolic and hyperbolic trajectories can still be propagated, but they do not receive a finite period or apoapsis. Invalid input, non-convergence, non-finite Stumpff values, non-finite states, and zero-radius states remain explicit failure paths.

05 · Limits & provenance

A useful simplification has boundaries.

The editable sandbox does not include atmospheric drag, lift, Earth’s J2 oblateness, third-body gravity, radiation pressure, finite-duration burns, enforced mass depletion, or spacecraft systems. It is a two-body instrument for asking clear questions, not a complete mission simulator.

The separate J2 investigation adds an axisymmetric degree-two gravity term with J2 = 1.08262668 × 10⁻³. It uses fixed-step RK4 at 5 seconds, checks 10- and 20-second steps, and compares against an independent SciPy DOP853 integration. The Earth pole is +Z. It retains the same exclusions for drag and other bodies.

The historical archive is separate. Its spacecraft paths are pre-generated JPL Horizons state vectors with recorded frames, epochs, units, and source queries. Archive playback does not modify those trajectories and does not claim that the sandbox’s two-body solver produced them.

Planet and spacecraft visuals are sourced and credited in the application. The craft is enlarged for visibility, and rendered rotation or surface orientation is illustrative.

Return to the project story →