The Lunar Phase Circle 

In LUNEX, the phases are treated as following an endless circular cycle, like a clock, from 0 to 360 degrees with the quarter moon phases occuring when the sun is at the four 90-degree points along the phase circle.

The camera/eye is fixed between the sun and moon at mean lunar distance while the sun slowly moves clockwise around the phase circle. The angular position of the sun along the phase circle is the lunar phase angle, where zero is directly forward, producing the new moon phase, 90 degrees is directly to the right, producing the first quarter phase, etc..



Phase
Angle  Phase Appearance
-----  ----------------
  0°   New Moon
 45    Waxing Crescent
 90    First Quarter
135    Waxing Gibbous
180    Full Moon
225    Waning Gibbous
270    Last Quarter
315    Waning Crescent
360    New Moon

Given the geocentric ecliptical longitudes of the sun and moon at the same moment, the simple lunar phase angle at the same moment can be computed to sufficient visual precision (sans librations) from a simple algorithm.
 Let:
 Ls = Geocentric Ecliptical Longitude of Sun  (0 to 360°)
 Lm = Geocentric Ecliptical Longitude of Moon (0 to 360°)
 PA = Geocentric Lunar Phase Angle (0 to 360°)

 Then:

 a = 360 − Lm + Ls
 if (a > 360) {a = a − 360}
 PA = 360 − a

 or:

 a = 360 − Lm + Ls
 PA = 360 − a −= (a > 360)? 360:0
Jay Tanner - 2025