Skip to content

Horizon dip and planetary motion

Choose a tag to compare

@clarkbw clarkbw released this 06 Oct 17:57
· 69 commits to main since this release
f1593e2

Almanac 0.7.0 provides apparent horizon dip and native planetary motion in TypeScript and Swift, with Earth included for solar-system views.

  • horizonDip(observer, heightAboveGroundM) gives the apparent altitude of an unobstructed horizon, accounting for Earth shape and terrestrial refraction. Eye height above the surface is separate from elevation above sea level; body altitudes remain relative to the horizontal plane.
  • Sun and Moon rise/set, local solar eclipse searches, and lunar eclipse visibility accept optional eye height. The default of zero preserves existing calls and results. Twilight and transit retain their definitions.
  • Mercury, Venus, Mars, Jupiter, and Saturn have apparent positions, refracted altitude/azimuth, point-center rise/set, illumination, approximate airless visual magnitude, and solar elongation through planetPosition, planetAltAz, planetEvents, and planetIllumination. Viewing windows combine these quantities with the consumer's twilight and observing policy.
  • planetHeliocentricPosition accepts those five planets and Earth. It returns geometric Sun-centered xAu, yAu, and zAu in fixed J2000 equatorial coordinates. Earth-based planetary queries reject Earth.

Planetary geometry is checked against JPL Horizons across 1950 through 2100, including both supported boundaries, conjunctions, near-zenith tracks, and polar grazing rise/set pairs. Angular limits remain one arcminute, physical range and heliocentric vector limits are 0.001 AU, and event limits are 60 seconds. Magnitudes are approximate: the pinned model differs from Horizons by up to 0.75 magnitudes for extreme Venus crescents in the retained evidence. Saturn's magnitude includes its rings.

Validation includes 193 TypeScript tests, 155 Swift release tests, offline fixture regeneration, cross-port reproduction within 5 scaled units / 100 ms, and Apple Watch hardware and simulator compilation. All 30 benchmark workloads pass the 20% regression limit in both ports. On the local machine, the five-planet 228-hour sky track takes about 17.2 ms in TypeScript and 6.5 ms in Swift; timings vary by machine.

The library retains zero runtime dependencies and zero runtime data files. Plans and specs live in #51; the repository contains the maintained API contract and scope.

npm install @openwaters/almanac@0.7.0
.package(url: "https://github.com/openwatersio/almanac.git", exact: "0.7.0")

Documentation scope: #50. Apparent horizon: #52. Planetary motion: #53. Release preparation: #55.

Full changelog.