Orbital Mechanics and rotation help requested

Hi everyone,

I have a complicated watch face i am working on and having trouble getting the mechanics of the orbital rotation and latitudes just right.

Here is the draft watchface i am working on:
https://beta.facer.io/watchface/AWwyqRC9Va/showcase

The earth orbits the sun properly, and the moon orbits the earth properly. The earth is supposed to be a replacement for the second hand, and that is working fine. The moon accurately shows the phase of the moon, and I’m happy with how that is working.

The problem is the rotation of the earth relative to the sun and the time of the day. There is a graphic for a red line that is supposed to overlay your latitude location accurately on the map, which isn’t working. Then the earth and the red line are supposed to rotate in sync with each other relative to the time of the day such that it is directly in front of the sun at noon, and directly opposite the sun at midnight, rotating counterclockwise. I can’t seem to get the rotation equations right…

If you look at this watchface that I have, it is similar in concept, except the sun and earth are stationary and not intended to orbit. Yet the earth and it’s longitudinal location properly have the latitude marked in red and rotate relative to the time of day to the sun.

Here are the current rotational equations that I am using, which are incorrect:

Earth:
(#DWFSS#+(#LAT#-#DWFHS#-60))

Red Line:
(#DWFSS#+(#LNG#-#DWFHS#-50))
Where the difference between 6- & 50 is simply a constant to account for the different original earth and red line graphic differences.

Any astrophysicists or orbital mechanics engineers out there?

Thanks in advance!

2 Likes

I think I solved my own problem.

earth rotation = (#DWFSS#+(#LAT#-#DWFHS#-265))

red line rotation = (#DWFSS#+(#LNG#-#DWFHS#-255))

difference between 265 & 255 is just to account for the graphic base orientation.

Stay tuned for the final version… :smile:

1 Like

Finished version is up…

2 Likes

Super

3 Likes

These are the questions I like to see when trying to solve a problem. Not sure it is answered here but the challenge is now open.

I had got as far as the moon orbiting the earth but I can’t quite figure out the rotation so the fill side always faces earth. I notice on the 2 above there is no moon image rotation, probably for the good reason it would just be silly on top of showing moon phase.

2 Likes

Hi @rob.fisk, yeah you got it right, there is no point of showing the moon rotation in that example since the moon phase is shown. But if you didn’t want to show the moon phase, it can simply be simulated by using the same rotation you have on the earth shadow. Nobody will notice the slight variation at that scale.

3 Likes

OK, I Had some coffee and came back to it.

I knew #DWFMS# had to come into it as that is the earth rotation.
I tried (#DWFSS#+#DWFMS#+90) but it rolled off over time.
I set the time machine to 15 minutes and it was 90° out.
It had to be a division to slow it so I tried 4 (15 into 60) but silly it’s 360°.
OK, 4 into 360 is 90 but that seemed too huge so I tried 9 and… Was his Name Oh!

(#DWFSS#+(#DWFMS#/9)+90)

I’m using this as an expression template for others to use so want it just right. Plus I’m a picky bigger.
Caffeine was the key.

2 Likes

No I don’t think that formula is it. It drifts for me, see below:


If you want to be precise, you need to add the angle between the moon and the earth at the sun. It’s quite a bit of geometry, converting polar and cartesian coordinates, and honestly I’d just approximate it at this scale.

2 Likes

Damn. I ran it for ages. Only really interested in the same side facing the earth, not actual reflection.

The difficult question is will I run out of coffee or honey first? It’s only instant so need to sweeten it slightly.

2 Likes

I definitely need more than a couple of hours sleep soon. I did have it and must have pasted over or undone it. The reasoning for the 9 was there initially but I must have dozed off and continued working then gone back.
(#DWFSS#+90+(#DWFMS#/12))
I watched that for the full minute 3 times. No drift. Yes, Once would have been enough but…

1 Like

Nope. A couple of degrees out by the 55th second.

Here you go, just populate it out in notepad++ and add theta to your rotation for the earth shadow, and you will get the rotation for the moon shadow. Use lots and lots of brackets everywhere, or you will get errors.

3 Likes

It was even more basic than that it’s just the earth was not rotating correctly nor the moon orbiting so.

I had the earth as minute not hour so after correction the moon’s movement is
((160+(50* sin(rad((#DWFKS#)-90))))+(18*sin(rad(((#DWFKS#*365/27.3))-90))))
Where
((160+(50* sin(rad((#DWFKS#)-90)))) is the earth’s.
So the moon rotation just needed to equal its motion as in all clock hands. It’s just the motion had to convert 360° into days and slow by orbit time: (#DWFKS#*365/27.3).

As usual I was overcomplicating things and not checking my previous work enough. That and the designer glitched out a couple of times so I was seeing incorrect motion for a correct expression because one it relied on had reverted to a previous, incompatible one. Had to close and reopen the browser.

1 Like

Oh, and cheers. Bookmarked for later but I am not actually doing moon shadow here but the orbits, or a circular representation. The half arc is just a visual to the rotation. As long as the moon is tide locked and the earth rotates 365 times an hour I’m a happy puppy.

1 Like