# How to calculate the moon phase angle?

I need to calculate the exact moon phase angle for each our of a day. I have my position in lat and long and a unix timestamp. At the end i would like to be able to caluculate the moon brightness with this formula: https://patents.google.com/patent/DE10113295A1

const moonPhaseAngle = Math.cos(( 2 * ( ( phase * 100 ) / 100 ) -1));

const moonBrightness = 10 * Math.sin( altitude ) * ( .5 + ( .5 * Math.cos( moonPhaseAngle ) ) );


This is my actual progress through web search. Thank you for helping me!

• I suggest that you get the book "Astronomical Algorithms" by Jean Meeus in order to get the half dozen or so equations needed to calculate the phase angle. Note that the phase angle calculation can be performed without using the observer's location. – JohnHoltz Oct 5 '19 at 3:14
• @JohnHoltz You are correct because we consider the moon's official phase to be the phase for a theoretical geocentric observer. The moon is close enough that its position in the sky and thus its "actual" phase depends on the observer's location. The most obvious example is that a solar eclipse looks different in different parts of the world at the same time, and isn't even visible in some parts of the world. – user21 Oct 6 '19 at 15:03
• Thank you for the responses! I have the observers position and calculate some values with the SunCalc Lib for JS. But I still can not get the angle ... – JKortmann Oct 7 '19 at 9:10
• Try using a library like pyephem or skyfield -- astronomy.stackexchange.com/questions/13488 may also help – user21 Oct 8 '19 at 0:16
• I may add: the brightness is not simple geometric math alone. The scattered intensity varies by observation angle. Direct back-scatter as on full moon scatters a higher amount of light than at 90° scatter angle. The effect may not be gigantic, but definitely measurable. – planetmaker Jun 22 at 22:43

I refer to the book : Astronomical Algorithms (Second Edition) by Jean Meeus.

1. To calculate the values of position angle of the bright limb and position angle you will need to calculate the apparent RA and DEC of the Sun and the Moon.

2. Code the equations for the Sun RA and DEC using Chapter 25. Please note that L0 (equ. 28.2) is in error To calculate T (Julian century you will need to compute Julian day (Chapter 7).

3. Code equations for the Moon RA and Dec from the equations given in Chapter 47.

4. For the calculation of Apparent RA and Dec you will need to compute Nutation and Obliquity - Equations in Chapter 22.

BTW. For all my calculations I have "standardized" on using the equations on page 144 for the variables : D, M, Mdash, F, and Omega. Fyi compare the equations for M given in this book ie. equations 25.2 and 47.3

1. Chapter 48 provides a formula (48.1) for the illuminated fraction of the moons disc.

5.1 I used 48.2 and 48.3