I know it’s a bit old thread, about calculating the Moon rotating, and Moon days. But Ben, despite you’r great Job with you’r calculation, it’s not correct. I took a look at you’r Link to the watch, which shows you’r rotating Moon, and the Lunar day, and the Moon goes much behind what’s correct. Take a look at my own Weather Site Aktuelle vejrdata fra Nakskov (look in the bottom of the Site)
It shows the exact position of the Moon, and where it is located on the Sky, and the Moon Rise, and Set.
I’m trying to figure out, an accurate script for Facer use, for the Moon rotation on a new watch I’m building up. Not a Moon rotating the traditionally way, but a fully rotation, showing images for each of the Moon days. But so far, it’s a bit of a “fight” to get it to works.
I tried doing it on Samsung’s Gear watch Designer, as they have a script build in to there designer, and it works perfectly on the minute; but unfortunately, you can’t see how this script are build
Thank you for your comments…
All the moon phase that I post the calculations is just about any less
about fully rotation, showing images for each of the Moon days
maybe the links below can help.
about position of the Moon, and where it is located on the Sky, and the Moon Rise, and Set. it requires a very long script that is quite difficult to put on the line tag. if the facer can provide the use of lua script it may be helpful.
@G7 - Great Job! I noticed, that you have turned the “Moon Ring” 180 degrees wrong The Moon is waning now.
I look forwards to that day, where it will be implemented as Tag, to have the GPS info. Then it will be more Fun and interesting, to “play” with Sun and Moon positions, and the rotations.
yes… you right the moon is waning crescent now around 19 to 20 age days.
for the moment I have not seen providing about GPS info for implemented as Tag this link as a reference Tags | Facer Documentation
OH!!! i’ve been looking for modulo for so long! Hope Facer adds it to the docs
And BTW, I’ve been working on moonphase on my own and I’m not much of a mathematician, but it seems I’ve come up with something that works (U’ll find it here : https://www.facer.io/watchface/9L6tZ49qzs )
My Formula is much simpler (and therefore probably wrong) :
October 19 2017 (day 292) was a new moon so i get a second value for that day: (292*86400)+(2017*31557600))
The Current day in second is: ((#DD#*86400)+(#Dy#*31557600))
I find the delta between the 2 values : (((#DD#*86400)+(#Dy#*31557600))-((292*86400)+(2017*31557600)))
Then I divise it by 29.5530588853 day (multiplied by seconds per day) ((((#DD#*86400)+(#Dy#*31557600))-((292*86400)+(2017*31557600)))/(29.5530588853*86400))
Then i keep only the decimal (((((#DD#*86400)+(#Dy#*31557600))-((292*86400)+(2017*31557600)))/(29.5530588853*86400))-floor(((((#DD#*86400)+(#Dy#*31557600))-((292*86400)+(2017*31557600)))/(29.5530588853*86400))))
Then I convert this into an angle starting from -90° and going to 90°: (((((((#DD#*86400)+(#Dy#*31557600))-((292*86400)+(2017*31557600)))/(29.5530588853*86400))-floor(((((#DD#*86400)+(#Dy#*31557600))-((292*86400)+(2017*31557600)))/(29.5530588853*86400))))*180)-90)
Hi,
Love your moon phase. I would like to add one to my watch face as I fly a rescue helicopter with NVG’s and moon phases is incredibly important. Can you tell me where you got your moon image and any other instructions you could give me please?
Kind Regards,
Peter
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
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))%
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:
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.
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
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.