[SOLVED] How To Tag Moon Phase Today Rotation

Thanks @Ben. The formula and example are perfect for what I need. Looks like you did what I was thinking in expanding out the ranges for the day indicators:

New:0 - 1.8
Full: 13.0 - 16.6
Last Quarter: 21.3 - 23.9
etc.

MoonAge = (((#Dy#12+#DM#)30+floor(((#Dy#12+#DM#)7-2)/12)-floor(((#Dy#12+#DM#)+9)/12)2+floor(((#Dy#12+#DM#)+45)/48)-floor(((#Dy#12+#DM#)+1197)/1200)+floor(((#Dy#*12+#DM#)+4797)/4800)+#Dd#-730521.1)%29.5305)

Text = New Moon
Transparency = $ MoonAge < 1.8 || MoonAge > 27.7 ? 100 : 0 $

Text = Waxing Crescent
Transparency = $ MoonAge > 1.9 && MoonAge < 5.5 ? 100 : 0 $

Text = First Quarter
Transparency = $ MoonAge > 5.6 && MoonAge < 9.2 ? 100 : 0 $

Text = Waning Crescent
Transparency = $ MoonAge > 9.3 && MoonAge < 12.9 ? 100:0 $

Text = Full Moon
Transparency = $ MoonAge > 13.0 && MoonAge < 16.6 ? 100 : 0 $

Text = Waning Gibbous
Transparency = $ MoonAge> 16.7 && MoonAge < 20.3 ? 100 : 0 $

Text = Last Quarter
Transparency = $ MoonAge > 20.4 && MoonAge < 23.9 ? 100 : 0 $

Text = Waxing Gibbous
Transparency = $ MoonAge > 24.0 && MoonAge < 27.6 ? 100 : 0 $

( all calculations carry an accuracy of +/- ) hope this help :slight_smile:

Should this be:
Text = New Moon
Transparency = $ MoonAge < 1.8 || MoonAge > 27.7 ? 100 : 0 $

Text = Waxing Crescent
Transparency = $ MoonAge > 1.9 && MoonAge < 5.5 ? 100 : 0 $

Text = First Quarter
Transparency = $ MoonAge > 5.6 && MoonAge < 9.2 ? 100 : 0 $

Text = Waxing Gibbous
Transparency = $ MoonAge > 9.3 && MoonAge < 12.9 ? 100:0 $

Text = Full Moon
Transparency = $ MoonAge > 13.0 && MoonAge < 16.6 ? 100 : 0 $

Text = Waning Gibbous
Transparency = $ MoonAge> 16.7 && MoonAge < 20.3 ? 100 : 0 $

Text = Last Quarter
Transparency = $ MoonAge > 20.4 && MoonAge < 23.9 ? 100 : 0 $

Text = Waning Crescent
Transparency = $ MoonAge > 24.0 && MoonAge < 27.6 ? 100 : 0 $

1 Like

yes u right :slight_smile:

1 Like

Seems to be working so far. I’m really taxing this design by making it near 100% using the Facer creator.

1 Like

nice work :slight_smile: make sure the moon age results xx.x
(moonAge * 10) / 10)

Am i the inly one who doesn‘t understand anything? :wink:

4 Likes

This is alot of information to take in, i would think this could also help with accurate tides as well. Since afterall, the moon controls that.

Improved syntax (same ‘simplex’ MoonAge method)

(UPDATE: Superseded, see below)


JulianDate(s):

base date:   J1721059.5 (1BCE-01-03 00:00:00.0 UTC)
lunar epoch: J2415020.0 (1899-12-31 12:00:00.0 UTC)

Moon Age:

synodic month 29.53058868

29.5306

(floor((((1721059.5+floor(#Dy#*365.2425)+#DD#+(#DH#*3600+#Dm#*60+#Ds#)/86400))-2415020.0)%29.5306)*100)/100)

Output: ##.##


Elongation:

Moon age to degrees (360 degrees / synodic month = 12.1907857977)

Elongation = MoonAge x 12.1908

((((1721059.5+floor(#Dy#*365.2425)+#DD#+((#DH#*3600+#Dm#*60+#Ds#)/86400))-2450841.7514)%29.5306)*12.1908)


Luminosity:

Luminosity = floor(( (1-cos( Elongation x 0.01745)) /2) x100) %

(floor(((1-cos(((((1721059.5+floor(#Dy#*365.2425)+#DD#+((#DH#*3600+#Dm#*60+#Ds#)/86400))-2450841.7514)%29.5306)*12.1908)*0.01745))/2)*100))

Output: ##.######

(floor((((1-cos(((((1721059.5+floor(#Dy#*365.2425)+#DD#+((#DH#*3600+#Dm#*60+#Ds#)/86400))-2450841.7514)%29.5306)*12.1908)*0.01745))/2)*100)*10)/10)%

Output: ##.0%

For Unix epoch time : (#DNOW#/1000)
so we can use Unix epoch time to UTC Julian Date @ JD
(floor(((#DNOW#/1000)/86400+2440587.5)*100000)/100000)

more details feel free see sample “Inspector Mode” available :slight_smile:

I hope it is useful for alls… :slight_smile:

3 Likes

Is your “moon phase level” the 1 of 29 listed in the comments above or the 1 of 8 standard recognized phases?

@ eradicator09 update for
Moon Phase Level 1 to 8
Level 1 = New Moon
Level 2 = Waxing Crescent
Level 3 = First Quarter
Level 4 = Waxing Gibbous
Level 5 = Full Moon
Level 6 = Waning Gibbous
Level 7 = Last Quarter
Level 8 = Waxing Gibbous

Moon Phase Level: (floor((((#DNOW#/1000)/86400+2440587.5)-2451550.1)%29.5305/3.6913125)+1)

Thank you note me :slight_smile:

Still cant get the MoonAge formulae to match New Moon tables, available on various websites.

Here is my revised formula:

  • Derived from original ‘Simple()’ moon phase function - reference: Ben Daglish -)
  • Ben (G7)'s suggested use of: ((#DNOW#/1000)/86400, changed to scientific notation
  • Synodic month: 29.5306, based on correct rounding for 29.53058868
  • Lunar epoch date of: 1970 Jan 7 20:36 - reference: Lunar Perigee and Apogee Calculator)
  • Trig2() (beta code) shown for comparison, which is probably (errors not withstanding) more accurate

JulianDate:

base date:   J1721059.5 (1BCE-01-03 00:00:00.0 UTC) as J1

#NOW#
base date:   J2440587.5 (1970-01-01 00:00:00.0 UTC)

(#DNOW#/8.64e7+2440587.5)

(floor((#DNOW#/8.64e7+2440587.5)*10000)/10000)


Lunation: (lunar cycles, starting 1900)

lunar epoch: J2415020.0 (1899-12-31 12:00:00.0 UTC)

(floor(((70*365.2425)+(#DNOW#/8.64e7))/29.5306))

(floor(865.7791+(#DNOW#/8.64e7)/29.5306))


Moon Age:

lunar epoch: J2440594.358333 (1970-01-07 20:36:00.0 UTC)

(floor(
(((#DNOW#/1000)/86400+2440587.5-2440594.3583)%29.5306)
*100)/100)

(floor(
((#DNOW#/8.64e7-6.8583)%29.5306)
*100)/100)

(floor(((#DNOW#/8.64e7-6.8583)%29.5306)*100)/100)

1 Like

Additional revised syntax (as above)


Elongation:

Elongation = MoonAge x 12.1908

(((#DNOW#/8.64e7-6.8583)%29.5306)*12.1908)


Luminosity:

Luminosity = floor(( (1-cos( Elongation x 0.01745)) /2) x100) %

Output: ##.######

(floor(((1-cos(
(((#DNOW#/8.64e7-6.8583)%29.5306)*12.1908)
*0.01745))/2)*100))

(floor(((1-cos((((#DNOW#/8.64e7-6.8583)%29.5306)*12.1908)*0.01745))/2)*100))


In range: 20-100% (for icon)

(20+floor(((1-cos((((#DNOW#/8.64e7-6.8583)%29.5306)*12.1908)*0.01745))/2)*80))


Output: ##.0%

(floor((((1-cos(
(((#DNOW#/8.64e7-6.8583)%29.5306)*12.1908)
*0.01745))/2)*100)*10)/10)%

(floor((((1-cos((((#DNOW#/8.64e7-6.8583)%29.5306)*12.1908)*0.01745))/2)*100)*10)/10)%

1 Like

Does it match the tables with this modification now? It looks to be close, it is showing the same at Ben’s example above yours.

The number in black/red is Ben’s, included for comparison.

Yes, it is closer. But the trig2() function (combined output of 4 or more complex lunar cycles) is clearly superior. I am going to continue testing, and also complete the trig1() code. All three (and ‘Conway’) are listed on the Ben-Daglish.net website (see above).

For now, I would recommend to use my latest ‘Simplex’ formula.


Still a work-in-progress:

Update: Now with attitude (tilt) :innocent: This is just baseline, with seasonal variance still to be added.

4 Likes

Hi Ben, can you PLS check what I am doing wrong with my moon phase here?

@brbr123 i thing “moon mask 2.png” need 2 rounded mask
see mps.png at example here inspect: Facer - Thousands of FREE watch faces for Apple Watch, Samsung Gear S3, Huawei Watch, and more

1 Like

i don’t know how you guys keep those expressions straight. That’s just amazing!

Full moon is at 4/7/2020, 9:35pm.
It’s now 8:12pm(4/20) and your indicator
is showing 99.9% Waiting for 100% ; )
Bravo!
Thanks

1 Like