[SOLVED] How To Tag Moon Phase Today Rotation

Not really, It works fine in Paris France (where I live).
… But I suppose that if it works in Paris, you could adapt it to other places by checking Moon Phases 2019 – Lunar Calendar and changing my formula accordingly.

Basically what u need to change in my formula is the “292” (2 times). Find the Day-in-year number for a new moon day.
Oh and my formula works for a moon that starts its move at 9 o’clock and ends at 3 o’clock.
Sorry explaining this in english is not that easy :slight_smile:

I’m switching on the inspector mode if u want to check it out. Good luck though, it’s a mess.

I’ve been looking over both calculations and can’t seem to get either to give super accurate results. Some phases appear to match up with various online moon calendars. However, other dates/phases appear to be off by 1-3 days. Does anyone have some additional ideas for this?

There has got to be an API or tag that can display this as an integer or percentage.

@ eradicator09 try this tag expression :
(floor(((((floor(365.25*((#Dy#-1)+4716))+(2-floor((#Dy#-1)/100)+floor(floor((#Dy#-1)/100)/4))-1096.5+#DD#+(#DH#/24+#Dm#/1440))-2451550.1)%29.530588853)/29.530588853)*100))%

hope this work :slight_smile:

Thanks, that’s another way of looking at it. I thought I could add some accuracy to the original formula, but I discovered a small glitch. I wanted to use UTC for the current hour. Problem with UTC is there is no UTC equivalent for Dates. When I get to the mismatch between my current time zone and UTC, I’d see the moon date jump back and forth. Overall the original long version was fairly accurate.

The other primary issue is the moon orbits in an elliptic. If you’ve seen all the recent news about the Super Blue Blood Moon, then you can see that the moons phases are perfectly regular. 29.530588853 days is the mean of several hundred years of data. The actual can fluctuate from 29.18 to about 29.93 days (according to wiki). The best we can hope for is around 98-99% accuracy at any one point. Unfortunately this end up being mildly frustrating to me.

I did some additional internet searches and didn’t find any free APIs that offered any more than the 8 standard moon phases.

Anyway, here is the comparison of the 3 formulas in practice against 3/2/2018 which should be a full moon:

My formula is in the middle and not to far off from your original and new ones.

1 Like

1 Like

Hey @Ben ,

I am working on a face that will do the standard 8 images. Do you think it is worth evening out the full, new, 1st, and 3rd? For instance, make full 3 days long instead of just a single day.

Like this:
0 = New Moon: 0%
1 = New Moon 1%
2 = Waxing Crescent 2%
3 = Waxing Crescent 6%
4 = Waxing Crescent 11%
5 = Waxing Crescent 17%
6 = Waxing Crescent 25%
7 = Waxing Crescent 34%
8 = First Quarter 43%
9 = First Quarter 53%
10 = First Quarter 63%
11 = Waxing Gibbous 73%
12 = Waxing Gibbous 82%
13 = Waxing Gibbous 90%
14 = Full Moon 96%
15 = Full Moon 100%
16 = Full Moon 97%
17 = Waning Gibbous 97%
18 = Waning Gibbous 92%
19 = Waning Gibbous 84%
20 = Waning Gibbous 75%
21 = Last Quarter 64%
22 = Last Quarter 53%
23 = Last Quarter 43%
24 = Waning Crescent 33%
25 = Waning Crescent 24%
26 = Waning Crescent 16%
27 = Waning Crescent 9%
28 = Waning Crescent 4%
29 = New Moon 1%

Or I could just pick even percentages. Is there a illumination formula?

First we need to calculations Moon Age

Moon Age = (((#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)

and Moon Elongation ( ecliptic (celestial) longitude ) degrees
Technically, the phases New Moon, First Quarter, Full Moon, and Last Quarter are defined to occur when the excess of the apparent ecliptic (celestial) longitude of the Moon over that of the Sun is 0, 90, 180, and 270 degrees, respectively
Ref: aa.usno.navy.mil/faq/docs/moon_phases.php

synodic month = 29.53 OR 29.5305 OR 29.53058868

Moon age to degrees
360 degrees / synodic month = 12.1907857977 degrees moon age

Moon Elongation = Moon Age * 12.1907857977

Moon Elongation to Moon Illumination Percentage
0% -> 50% -> 100% -> 50% -> 0% = New Moon -> First Quarter -> Full Moon -> Last Quarter -> New Moon
floor(((1 - cos( Elongation * 0.01745)) / 2) * 100)

so Moon Illumination Percentage
± (floor(((1-cos((floor((((#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)*12.1907))*0.01745))/2)*100))%

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

1 Like

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: