mirror of
https://github.com/acamarata/moon-sighting.git
synced 2026-06-30 19:04:24 +00:00
Add typedoc and typedoc-plugin-markdown as devDependencies. Add typedoc.json config targeting src/index.ts with markdown output to .github/wiki/api. Add docs script to package.json. Generate initial API reference pages. Part of T-E8-03 — TypeDoc automation for all 12 JS/TS packages.
1.4 KiB
1.4 KiB
moon-sighting / getMoon
Function: getMoon()
getMoon(
date?,lat,lon,elevation?):MoonSnapshot
Defined in: api/index.ts:727
Combined kernel-free moon snapshot for a time and location.
Calls getMoonPhase(), getMoonPosition(), getMoonIllumination(), and getMoonVisibilityEstimate() in a single request. Convenient for dashboards and apps that need all four values together.
Works WITHOUT a kernel (all Meeus-based approximations).
Parameters
date?
Date = ...
Date and time (default: now)
lat
number
Observer geodetic latitude in degrees (north positive)
lon
number
Observer longitude in degrees (east positive)
elevation?
number = 0
Observer height above WGS84 ellipsoid in meters (default: 0)
Returns
MoonSnapshot with phase, position, illumination, and visibility estimate
Example
const moon = getMoon(new Date(), 51.5, -0.1)
console.log(moon.phase.phaseName) // 'Waxing Crescent'
console.log(moon.position.altitude) // degrees above horizon
console.log(moon.illumination.fraction) // 0.0 to 1.0
console.log(moon.visibility.zone) // 'A' through 'D'