The Moon's phase at an instant and its named phase #6

Closed
opened 2026-10-22 22:33:48 -05:00 by jeff · 0 comments
Owner

Part of #1

Parent

#1

What to build

The Moon's phase at an instant, from ch. 48's exact form using the apparent positions of the Moon and the Sun: elongation, phase angle, illuminated fraction, the position angle of the bright limb, whether the Moon is waxing or waning, and its named phase.

Named phases are eight equal 45° sectors of elongation centered on 0°, 45°, …, 315°: new Moon, waxing crescent, first quarter, waxing gibbous, full Moon, waning gibbous, last quarter, waning crescent. The name depends only on the sky, never on a calendar day or a timezone.

Acceptance criteria

  • Ch. 48's worked example passes to the printed precision
  • The illuminated fraction is added to the Horizons reference tables and agrees within the stated tolerance
  • Ranges: phase angle in [0°, 180°], illuminated fraction in [0, 1], elongation and bright limb angle in [0°, 360°)
  • Properties: the illuminated fraction agrees with the phase angle; the named phase agrees with the elongation sector; NaN or ±∞ in gives NaN out
  • Every new public declaration has a doc comment giving units, time scale and reference frame, and citing the chapter and equation of Meeus it implements
  • Every source used is in the README's references cited
  • zig build test, zig build check, zig fmt --exclude zig-pkg --check . and reuse lint pass
Part of #1 ## Parent #1 ## What to build The Moon's phase at an **instant**, from ch. 48's exact form using the apparent positions of the Moon and the Sun: **elongation**, **phase angle**, **illuminated fraction**, the position angle of the **bright limb**, whether the Moon is waxing or waning, and its **named phase**. Named phases are eight equal 45° sectors of elongation centered on 0°, 45°, …, 315°: new Moon, waxing crescent, first quarter, waxing gibbous, full Moon, waning gibbous, last quarter, waning crescent. The name depends only on the sky, never on a calendar day or a timezone. ## Acceptance criteria - [ ] Ch. 48's worked example passes to the printed precision - [ ] The illuminated fraction is added to the Horizons reference tables and agrees within the stated tolerance - [ ] Ranges: phase angle in [0°, 180°], illuminated fraction in [0, 1], elongation and bright limb angle in [0°, 360°) - [ ] Properties: the illuminated fraction agrees with the phase angle; the named phase agrees with the elongation sector; NaN or ±∞ in gives NaN out - [ ] Every new public declaration has a doc comment giving units, time scale and reference frame, and citing the chapter and equation of Meeus it implements - [ ] Every source used is in the README's references cited - [ ] `zig build test`, `zig build check`, `zig fmt --exclude zig-pkg --check .` and `reuse lint` pass
jeff self-assigned this 2026-10-22 23:51:41 -05:00
jeff closed this issue 2026-10-23 00:24:55 -05:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
jeff/zig-astro#6
No description provided.