The first question we asked when starting Vedākṣha was whether to wrap an existing ephemeris library — Swiss Ephemeris, VSOP87, or one of the various Python wrappers around them. The answer was no, and for a reason that goes beyond the usual "not invented here" instinct.
Clean-room means something specific here: every algorithm in the computational core is derived from primary published sources — NASA JPL technical reports, IAU resolutions, IERS conventions, and peer-reviewed papers — not from existing open-source implementations. When a number comes out of the engine, we can trace it to a page in a source document, not to another codebase.
Why provenance matters for an astrological engine
Astrology software has accumulated decades of copying. A rounding convention introduced in one library propagates to another, and by the time someone traces a discrepancy to its origin, the original code is gone. A clean-room implementation breaks that chain. You can point at equation (3.1) in the IERS Conventions 2010 and say: that is exactly what the code computes.
For Vedic astrology this matters even more. Ayanamsha values differ by arcseconds between implementations — arcseconds that shift nakshatra boundaries and change dasha periods. When a practitioner asks why their chart shows a different nakshatra than another tool, the answer should be traceable to a specific ayanamsha definition and reference epoch, not to an undocumented behavioral quirk.
Starting with JPL DE440
Planetary positions start with the JPL Developmental Ephemeris. DE440 is the current long-arc solution, covering 1550 to 2650 CE, developed by Park, Folkner, Williams, and Boggs (2021). We use the SPK kernel format — binary files containing Chebyshev polynomial coefficients for each body over each time interval.
The SPK reader is implemented from scratch against the SPICE toolkit documentation. A record maps to a time window and a set of coefficients. Position evaluation is three nested Chebyshev recurrences — one per Cartesian component — using the standard recurrence relation T_n+1(x) = 2x·T_n(x) − T_n-1(x). Velocity follows from the derivative recurrence without finite differences.
This gives barycentric positions in the ICRS frame with sub-kilometer accuracy across the covered arc. The Sun is recovered as the difference between the Solar System Barycenter and the Earth-Moon Barycenter, adjusted by the lunar mass fraction.
fn cheby_eval(coeffs: &[f64], x: f64) -> f64 {
let (mut t0, mut t1) = (1.0, x);
let mut result = coeffs[0] * t0 + coeffs[1] * t1;
for c in &coeffs[2..] {
let t2 = 2.0 * x * t1 - t0;
result += c * t2;
(t0, t1) = (t1, t2);
}
result
}Clenshaw recurrence for Chebyshev evaluation — the core of every planetary position computation.
The coordinate pipeline: ICRS to ecliptic
Barycentric ICRS coordinates are not what astrology needs. The pipeline from raw SPK output to an ecliptic longitude has six steps, each with its own error budget.
Light-time correction
We observe planets at their retarded position — where they were when the light left, not where they are now. Solved iteratively: compute distance, subtract light travel time from epoch, re-evaluate. Converges in 3 iterations to sub-nanosecond accuracy.
Frame bias & precession
The IAU 2006 precession model (Capitaine et al.) applies a matrix built from polynomial expansions of the precession angles ψ_A, ω_A, and χ_A. The frame bias matrix corrects the 17.3 mas offset between the dynamical and ICRS equinox.
Nutation
The IAU 2000B nutation model — 77 luni-solar terms plus 687 planetary terms — gives the true equator and equinox. The full MHB2000 solution from Mathews, Herring & Buffett (2002) is implemented, not the truncated IAU 1980 model used in older software.
Aberration
Annual aberration shifts apparent positions by up to 20.5 arcseconds toward the direction of Earth's velocity. We apply the rigorous relativistic formula from the IERS Conventions, not the classical κ/c approximation.
Ecliptic rotation
Rotation from the true equator of date to the ecliptic of date uses the obliquity from the IAU 2006 model. The result is the apparent ecliptic longitude — the number that goes into every chart computation.
Topocentric correction
For ascendant and house calculations, parallax correction shifts the Moon's position by up to 57 arcminutes depending on geographic location. Applied using the WGS84 ellipsoid for observer coordinates.
Delta T: the most underestimated problem
JPL ephemerides are tabulated in Barycentric Dynamical Time (TDB). Astrological inputs are in local civil time — UTC or a named timezone. The conversion chain is: local time → UTC → UT1 → TT → TDB. Each step has different uncertainty characteristics.
Delta T (ΔT = TT − UT1) is the accumulated difference between atomic time and Earth rotation, currently around 69 seconds. For modern dates it comes from IERS Bulletin A. For historical dates we use the Morrison-Stephenson polynomial model extended by Espenak-Meeus. For dates before 1620, the secular term dominates and uncertainty grows to minutes — a fact that matters enormously for historical chart rectification.
We validate ΔT output against the Espenak tables published at NASA GSFC and against JPL Horizons at 50-year intervals from −500 to 2500. Every value is within the published uncertainty bounds for its era. The implementation uses Rust's f64 throughout — 64-bit double precision is sufficient for all ephemeris calculations given that the underlying SPK data carries ~14 significant digits.
Validation against JPL Horizons
The definitive validation target is JPL Horizons — the same ephemeris data, independent implementation. We run a test suite that queries Horizons-equivalent reference values for all planets at 200 dates spanning 1800–2100, covering both historical and predictive ranges.
Results: Sun, Moon, and inner planets match to within 0.1 arcseconds of apparent geocentric ecliptic longitude. Outer planets (Jupiter through Neptune) match to within 0.01 arcseconds. The residuals are consistent with the expected differences from slightly different ΔT models, not from algorithmic errors.
Ascendant and Midheaven values are validated against the same reference positions used by the Swiss Ephemeris test suite, cross-checked at 100 geographic locations.
Primary sources cited in the implementation
Park et al. (2021)JPL DE440/DE441 solution — The JPL Planetary and Lunar Ephemerides DE440 and DE441.
IAU 2006Capitaine et al. — IAU 2006 precession model. A&A 412, 567–586.
MHB2000Mathews, Herring, Buffett — Modeling of nutation and precession. JGR 2002.
IERS Conventions 2010Petit & Luzum — Technical Note 36. Chapter 5: Transformation between celestial and terrestrial systems.
Espenak & MeeusFive Millennium Canon of Solar Eclipses — ΔT polynomial expressions.
Morrison & Stephenson (2004)Historical values of the Earth's clock error ΔT and the calculation of eclipses. JHA 35.
Naif SPICESPK Required Reading — NASA/JPL kernel format specification.
The result is an engine where you can open the source, find the function that computes a planetary position, and follow the citations back to the equations it implements. That is what clean-room means in practice — not just "we didn't copy code," but "we can show our work."