Skip to content

Theory-to-Code Mapping

Every equation in pg_orbit traces to a published, peer-reviewed source. This page provides the complete mapping between the celestial mechanics literature and the source files that implement each theory.

If a constant, algorithm, or formula appears in the code without a citation, that is a defect to be corrected.

The core satellite propagation theory, implemented by Bill Gray’s sat_code library.

TheorySource PaperWhat it computesCode location
Mean element recoveryBrouwer (1959)Original mean motion n0n_0' and semi-major axis a0a_0' from input TLE, removing secular J2J_2 perturbationssat_code/common.cpp:sxpall_common_init()
Secular perturbationsLane & Cranford (1969); Hoots & Roehrich STR#3Secular rates of MM, ω\omega, and Ω\Omega due to J2J_2, J4J_4sat_code/common.cpp:sxpx_common_init()
Atmospheric dragHoots & Roehrich STR#3BB^* formulation of drag; C1C_1, C2C_2, C4C_4 coefficients; perigee-dependent ss parametersat_code/common.cpp:sxpx_common_init(); sat_code/sgp4.cpp:SGP4_init()
Short-period perturbationsLane & Cranford (1969); Brouwer (1959)Oscillatory corrections to radius, argument of latitude, node, and inclinationsat_code/common.cpp:sxpx_posn_vel()
Kepler equationClassicalNewton-Raphson with second-order correction, bounded first stepsat_code/common.cpp:sxpx_posn_vel()
Deep-space resonanceHujsak (1979)Lunar/solar gravitational perturbations; geopotential resonance for 12-hour and 24-hour orbitssat_code/deep.cpp:Deep_dpinit(), Deep_dpsec(), Deep_dpper()
Near-earth propagationHoots & Roehrich STR#3SGP4 main loop: secular + short-period + drag termssat_code/sgp4.cpp:SGP4()
Deep-space propagationHoots & Roehrich STR#3SDP4: SGP4 core + deep-space secular/periodic correctionssat_code/sdp4.cpp:SDP4()
Near/deep selectionHoots & Roehrich STR#3Period threshold: 225 minutes (n<2π/225n < 2\pi/225 rad/min)sat_code/norad.h:select_ephemeris()

Hoots, F. R. & Roehrich, R. L. (1980). “Models for Propagation of NORAD Element Sets.” Spacetrack Report No. 3, Aerospace Defense Command, Peterson AFB.

This is the canonical SGP4/SDP4 reference. All subsequent implementations, including Vallado’s 2006 revision, trace back to this report.

TheorySourceWhat it computesCode location
GMSTVallado (2013) Eq. 3-47; IAU 1982Greenwich Mean Sidereal Time from Julian datesrc/sidereal_time.c:gmst_from_jd()
TEME to ECEFVallado (2013)Z-axis rotation by GMST-\text{GMST}; velocity cross-product correctionsrc/coord_funcs.c:teme_to_ecef()
Geodetic from ECEFBowring (1976)Iterative latitude from ECEF Cartesian on WGS-84src/coord_funcs.c:ecef_to_geodetic()
Topocentric transformStandard SEZECEF range vector rotated to South-East-Zenith; azimuth from northsrc/coord_funcs.c:ecef_to_topocentric()
Observer to ECEFGeodesy standardWGS-84 ellipsoid surface point to Cartesiansrc/coord_funcs.c:observer_to_ecef()
Range rateDot productProjection of relative velocity onto line-of-sight unit vectorsrc/coord_funcs.c:eci_to_topocentric()
Semi-major axis from nnKepler’s third lawa=(ke/n)2/3a = (k_e / n)^{2/3} in earth radiisrc/tle_type.c:tle_perigee()
IAU 1976 precessionLieske et al. (1977)Three Euler angles ζA\zeta_A, zAz_A, θA\theta_A for precession from J2000 to datesrc/precession.c:precess_j2000_to_date()
Ecliptic to equatorialIAUX-axis rotation by obliquity ε0=23.4392911°\varepsilon_0 = 23.4392911\degreesrc/planet_funcs.c:ecliptic_to_equatorial()
  • Vallado, D. A. (2013). Fundamentals of Astrodynamics and Applications, 4th ed. Microcosm Press.
  • Lieske, J. H. et al. (1977). “Expressions for the Precession Quantities Based upon the IAU (1976) System of Astronomical Constants.” Astronomy & Astrophysics, 58, 1-16.
  • Bowring, B. R. (1976). “Transformation from Spatial to Geographical Coordinates.” Survey Review, 23, 323-327.
TheorySourceBodiesAccuracyCode location
VSOP87Bretagnon & Francou (1988)Mercury through Neptune~1 arcsecondsrc/vsop87.c
ELP2000-82BChapront-Touze & Chapront (1988)Moon~10 arcsecondssrc/elp82b.c

Bretagnon, P. & Francou, G. (1988). “Planetary Theories in Rectangular and Spherical Variables. VSOP87 Solutions.” Astronomy & Astrophysics, 202, 309-315.

pg_orbit uses the VSOP87 rectangular ecliptic J2000 variant. The truncated coefficient tables provide full accuracy within the validity range of the theory (roughly 4000 BCE to 8000 CE for the inner planets, with degradation for the outer planets beyond ±\pm2000 years from J2000).

Chapront-Touze, M. & Chapront, J. (1988). “ELP 2000-85: A Semi-Analytical Lunar Ephemeris Adequate for Historical Times.” Astronomy & Astrophysics, 190, 342-352.

The 82B revision is the version implemented. It provides geocentric ecliptic coordinates for the Moon, accounting for the principal perturbations from the Sun but not the complete set of planetary perturbations available in modern lunar ephemerides like DE421.

TheorySourceMoonsAccuracyCode location
L1.2Lieske (1998)Io, Europa, Ganymede, Callisto~1 arcsecondsrc/l12.c
TASS17Vienne & Duriez (1995)Mimas through Iapetus~1-5 arcsecondssrc/tass17.c
GUST86Laskar & Jacobson (1987)Miranda through Oberon~5-10 arcsecondssrc/gust86.c
MarsSatJacobson (2010)Phobos, Deimos~1 arcsecondsrc/marssat.c
  • Lieske, J. H. (1998). “Galilean Satellites of Jupiter.” Astronomy & Astrophysics Supplement Series, 129, 205-217.
  • Vienne, A. & Duriez, L. (1995). “TASS1.7: An Analytical Theory of the Motion of the Main Satellites of Saturn.” Astronomy & Astrophysics, 297, 588-605.
  • Laskar, J. & Jacobson, R. A. (1987). “GUST86: An Analytical Ephemeris of the Uranian Satellites.” Astronomy & Astrophysics, 188, 212-224.
  • Jacobson, R. A. (2010). “The Orbits and Masses of the Martian Satellites and the Libration of Phobos.” Astronomical Journal, 139, 668-679.
TheorySourceWhat it computesCode location
Lambert solverIzzo (2015)Transfer velocity vectors given two positions and time of flightsrc/lambert.c
Keplerian propagationClassicalTwo-body elliptic/hyperbolic orbit from elementssrc/elliptic_to_rectangular.c
  • Izzo, D. (2015). “Revisiting Lambert’s Problem.” Celestial Mechanics and Dynamical Astronomy, 121, 1-15.

The Izzo solver uses Householder iterations for fast convergence and handles both short-way and long-way transfers. pg_orbit uses the prograde (short-way) solution by default.

TheorySourceWhat it computesCode location
Carr source regionsCarr et al. (1983)Jupiter-Io decametric burst probability from CML and Io phasesrc/radio_funcs.c
CML computationStandardJupiter System III Central Meridian Longitudesrc/radio_funcs.c

Carr, T. D. et al. (1983). “Phenomenology of Magnetospheric Radio Emissions.” Physics of the Jovian Magnetosphere, Cambridge University Press, 226-284.

The Vallado 518 test vectors are the definitive verification dataset for SGP4 implementations. Each row specifies a NORAD ID, minutes since epoch, and expected position/velocity in TEME.

Sample from the verification suite:

0.039550
# NORAD 00005 (Vanguard 1) - LEO, low eccentricity
# Minutes: 360.00 Expected X: -7154.031380 Y: -3783.176825 Z: -2073.655980
# NORAD 29238 (GPS BIIR-11) - MEO, near-circular
# Minutes: 0.00 Expected X: -22503.132440 Y: 14513.963880 Z: 180.989390
# NORAD 28350 (Galaxy 15) - GEO, deep-space SDP4
# Minutes: 0.00 Expected X: -33110.816260 Y: 26044.993650 Z: -20.725400

These vectors cover the full range of orbit types that pg_orbit handles: LEO (SGP4), MEO (SGP4), GEO (SDP4), high-eccentricity Molniya (SDP4), and deep-space GPS (SDP4). Any implementation that matches all 518 vectors is functionally equivalent to the Vallado reference.

A quick reference for finding the implementation of a specific theory.

Source fileTheory/FunctionLines (approx)
src/vsop87.cVSOP87 planet positions~3000 (coefficient tables)
src/elp82b.cELP2000-82B Moon position~2000 (coefficient tables)
src/l12.cL1.2 Galilean moons~800
src/tass17.cTASS17 Saturn moons~1200
src/gust86.cGUST86 Uranus moons~600
src/marssat.cMarsSat Mars moons~400
src/precession.cIAU 1976 precession~60
src/sidereal_time.cGMST computation~40
src/lambert.cIzzo Lambert solver~300
src/coord_funcs.cCoordinate transforms~650
src/pass_funcs.cPass prediction algorithm~550
src/gist_tle.cGiST altitude-band index~400
src/planet_funcs.cObservation pipeline~250
src/radio_funcs.cJupiter radio emission~200
sat_code/sgp4.cppSGP4 near-earth propagator~300
sat_code/sdp4.cppSDP4 deep-space propagator~200
sat_code/deep.cppDeep-space perturbations~800
sat_code/common.cppShared SGP4/SDP4 initialization~250