Lunar computes its astronomy on-device from the algorithms in Jean Meeus, Astronomical Algorithms, 2nd edition. A separate golden-case suite checks the results against independent published references. The reference values are fixed in the test suite; a disagreement fails the release build.
What is checked
Phase events
New Moon, first quarter, Full Moon, and last quarter instants are tested across 80 years. The release tolerance is less than two minutes against 48 instants published by the U.S. Naval Observatory at one-minute resolution.
Distance, illumination, and disc geometry
Geocentric distance and illuminated fraction are compared directly with JPL Horizons DE441. Lunar’s required 60-term Meeus lunar series is held to 50 km for distance and 0.001 in illuminated fraction. The dedicated apogee/perigee solver is separately held to 20 km at apsis.
A 12-case Horizons fixture checks apparent lunar coordinates, angular diameter, and the projected direction of the illuminated side. Right ascension and ecliptic longitude are held to 7.2 arcseconds; declination and ecliptic latitude to 3.6 arcseconds; apparent diameter to 0.3 arcseconds; and bright-side orientation to 0.01° whenever more than 1% of the disc is illuminated.
Observer-specific values
Moonrise, transit, and moonset are compared with USNO Astronomical Applications data. For observers within 60° latitude, the target is two minutes. Tests also cover adjacent-lunation days, multiple events on one civil day, circumpolar days, and days when the Moon never rises.
Topocentric altitude and azimuth include lunar parallax and atmospheric refraction. Above 10° altitude they are held to 0.05° against JPL Horizons; near the horizon, where refraction models diverge, altitude is held to 0.12°. Observer-relative disc rotation is independently checked from Horizons declination and local hour angle to 0.002° below 80° altitude, with a 0.02° bound near the zenith where the angle changes rapidly.
Eclipses and sunlight
Lunar eclipse type, geometry, and shadow contacts are compared with NASA GSFC. Greatest eclipse and every checked penumbral, partial, and total contact are held to less than three minutes; gamma and umbral magnitude are held to 0.01.
Sunrise, sunset, civil twilight, golden hour, and blue hour use the same solar-altitude solver. The checked fixture contains 60 published boundary instants from NOAA, USNO, and JPL Horizons, including 18 NOAA photography and twilight boundaries and a NOAA high-latitude no-event case; the event-time bound remains less than two minutes.
Sources
- JPL Horizons — DE441 distance, illumination, apparent position, disc geometry, and solar-altitude references.
- USNO Primary Phases of the Moon — principal-phase instants.
- USNO Astronomical Applications — rise, transit, set, and solar-event references.
- NASA GSFC Five Millennium Catalog of Lunar Eclipses — eclipse types, magnitudes, geometry, and contact sheets.
- NOAA Solar Calculator — independent sunrise, sunset, photography-light, twilight, and polar-topology cross-checks.
Scope and limitations
Lunar is an observation-planning and reference app, not a navigation or safety instrument. Atmospheric refraction, terrain, buildings, and weather can change what an observer actually sees near the horizon. Solar-eclipse entries in Lunar 1.0 provide global awareness from a bundled NASA catalog; they do not claim local solar-eclipse circumstances.