Reference · The same, with suncalc 1's conventions (radians, azimuth from south)
getMoonIlluminationfunction
The Moon's phase, as suncalc 1 gave it.
Import it
import { getMoonIllumination } from "@johnmorrisdotca/wakusei-planets/suncalc/legacy";
Definition
function getMoonIllumination(date?: Date | number): LegacyMoonIllumination
Parameters
| Name | Type | Description |
|---|---|---|
date (optional) | number | Date | The moment; now when left out. |
Returns
LegacyMoonIllumination
The lit fraction, the phase 0 to 1 and the bright limb's angle in radians (negative while waxing).
Examples
import { getMoonIllumination } from "@johnmorrisdotca/wakusei-planets/suncalc/legacy";
const { fraction, angle } = getMoonIllumination(new Date(Date.UTC(2026, 10, 24, 14)));
console.log(fraction.toFixed(2), angle < 0);1.00 trueWhat it prints (run when this page was built)