Help!!! I have tried to paste in several different equations but none of them work as I am wanting. I have a background that I would like to rotate from 3 o’clock to 9 o’clock and then reverse direction back to 3 o’clock. This cycle (3-9-3) should take 29.5 days to complete its movement. If it is easier, I would even be willing for a cycle to complete every 30 days. This is a moon cycle that only appears in an upper window. The movement is a rocking motion that repeats nonstop. Please help me insert the right equations for this process.
Hi. The rotational moonphase formula is very difficult and i don‘t think you will find someone who can solve your special problem. The only one i know may be @mikeoday, he is very good in coding.
I can give you a formula for a 360 degrees rotation (180 degrees for a full cyle), maybe you can adapt it and cover the part you don‘t need with another layer.
Ha, flattery will get you everywhere @GAUSS!
Ok, let me work the problem…
Seconds in one day: 24 x 60 x 60 = 86,400
Seconds in average lunar month = 29.530587981 x 86,400 = 2,551,442.80156
milli Seconds in average lunar month = 2,551,442,802
Desired range of rotation 180 degrees offset by 90
Positive rotation: ((((#DNOW#%2551442802)/2551442802)x180)+90)
Negative rotation: (270-(((#DNOW#%2551442802)/2551442802)x180))
Test: (#DNOW#%(2x2551442802))<2551442802 then positive rotation else negative rotation
I think that might work.
Now, the above will just give you a rotation from an arbitrary start point that won’t coincide with an actual moon phase. Let me look up the correction …
Ok, a correction that can be used is to subtract the following from #DNOW#: 583,104,471
This is for the new moon. That is, the new moon will be at either end of the cycle with the full moon in the middle.
So corrected rotation becomes:
Note that the above is an approximation of the actual moon phase which can vary by up to 14 hours or so from the average phase obtained by assuming a circular orbit with a fixed period of 29.53 days.
I knew you can do.
Thank you for the formula. The movement that your formula creates is acceptable for this watch face. I would like to ask you another question. Are these calculations made using calculus?
I am glad it worked ok.
The expressions are just based on fractions …
(number of milliseconds since last new moon ) /
(number of milliseconds in a lunar cycle )
gives an increasing number from 0 to 1
multiplying this by the desired angle gives the rotation
Based on moon age (formulae):
I get the following:
- moon age :: 0 … 29.53 (days)
- divided by 29.53/2 :: 0 … 2 (plus fractional)
- 1 - x :: -1 … 0 … 1
- x * 180 :: -180 … 0 … 180 (angle)
- abs(x) :: 180 … 0 … 180 (angle)
- adjust angle 90 degrees
An elegant solution, well done!