moon-sighting/.github/wiki/api/functions/getMoonIllumination.md
Aric Camarata 2992dcee21 docs: add TypeDoc API generation (typedoc@0.28.19 + typedoc-plugin-markdown@4.11.0)
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.
2026-05-30 16:41:59 -04:00

1.1 KiB

moon-sighting v1.1.1


moon-sighting / getMoonIllumination

Function: getMoonIllumination()

getMoonIllumination(date?): MoonIlluminationResult

Defined in: api/index.ts:592

Compute the Moon's illumination fraction, phase cycle position, and bright limb angle.

Works WITHOUT a kernel (uses Meeus Ch. 47/48 approximation). Accuracy: illumination fraction ~0.5%, phase fraction ~0.003. Drop-in replacement for suncalc.getMoonIllumination() — same field names and conventions.

Parameters

date?

Date = ...

Date to compute illumination for (default: now)

Returns

MoonIlluminationResult

fraction (0-1), phase (0-1 cycle), angle (bright limb position angle, radians), isWaxing

Example

const illum = getMoonIllumination(new Date())
console.log(illum.fraction)  // e.g. 0.43 (43% illuminated)
console.log(illum.phase)     // e.g. 0.18 (waxing crescent territory)