Skip to main content
SZCZ

Sun, Earth, Moon

Celestial sphere

I saw this picture on Wikipedia the other day.

The Eta Aquariids meteor shower, which peaked in early May this year, was captured in this stunning image by astrophotographer Petr Horálek.
ESO/P. Horalek, CC BY 4.0, via Wikimedia Commons

It struck me that the ecliptic is almost vertical in this picture, super close to the zenith. I've always lived in the 51°N-53°N range where the ecliptic never moves up so high off the horizon.

Everyone knows the Earth orbits the Sun, the Moon orbits the Earth, and the Earth's axis is tilted. But it's surprisingly easy to know those facts without having a mental model of what they imply. This post is an attempt to build that model.

So I'll put myself on the line a bit and try to do a digest of the obvious, i.e. the Sun - Earth - Moon system. I obviously won't cover everything but I'll try to do an overview of the important stuff. And yeah, some of this is obvious - though hopefully still fun to think about. By the end we'll have enough machinery to work out roughly when the picture above was taken - without peeking at the metadata.

As a bonus, I've been enjoying Three.js based visualizations I can get Gemini to cook up. They're almost good as-is and need very few tweaks. Incidentally, I find these three.js visualizations the best way to actually do 3D diagrams.

Initially I wanted to also cover the Moon's nodal precession here but I'll have to do that later.

The celestial geometry

Before we get to the ecliptic, we need one useful abstraction: the celestial sphere. Imagine the Earth at the centre of an enormous sphere with the stars, Sun and Moon projected onto its inside surface. The stars are, of course, nowhere near the same distance from us in reality, but they are so far away compared with the Earth-Moon system that treating them as if they all lie on one giant sphere turns the geometry of the sky into ordinary geometry on a sphere.

With that picture in mind, we can talk about paths, poles and great circles on the sky without worrying about how far away anything actually is.

Let's start with the ecliptic: the plane of the Earth's orbit around the Sun - equivalently, the plane the Sun appears to move in when watched from the Earth. The Earth orbits in that plane but crucially, its axis of rotation is tilted with respect to it by about ϵ=23.4. This is where we get the seasons and days of varying length. If the Earth's axis were perpendicular to the ecliptic (i.e. the equator lined up with the ecliptic plane) we'd have nice 12h days and 12h nights, and every place on Earth would experience them the same way.

So: we have the ecliptic plane; the Earth orbits in that plane, and its axis is tilted with respect to it. The Moon then orbits around the Earth but to make it more complicated, its orbital plane is tilted another ~5.1 degrees with respect to the ecliptic. We end up with something like this.

I added two nodes on the Moon's orbit: those are the points where the Moon's orbit crosses the ecliptic plane. One is the ascending node (since the Moon is crossing on the way UP), the other the descending node.

If you keep watching you might notice the nodes themselves are slowly rotating too - that's the precession of the lunar nodes, an 18.6-year cycle.

Equinoxes and solstices

Due to the axial tilt the Sun will have a different declination throughout the year. When the North Pole side of Earth is facing the Sun we see it at its highest declination ϵ=23.4. When the North Pole side is facing the opposite way the Sun's at its lowest declination - ϵ=23.4. The two in-between points are the equinoxes, where the Sun crosses the celestial equator. Those are the 2 days a year where we see 12h days and nights (or close enough to it due to atmospheric refraction and the fact that we need just the top of the Sun to be visible to count as a sunrise).

Note some consequences of this fact:

  • on the equinoxes the Sun will rise and set due east and west, respectively[1]
  • during the Northern hemisphere summer the Sun will rise and set north of east, west respectively; and south of them during the winter
  • during the summer solstice the Sun will be directly overhead at noon at the Tropic of Cancer
  • during the winter solstice the Sun will be directly overhead at noon at the Tropic of Capricorn

Let's call the Sun's declination δ and our latitude ϕ. At noon the Sun sits at an altitude of 90|ϕδ|: if we're at latitude ϕ=δ the Sun passes directly overhead, and every degree of latitude away from that costs us one degree of altitude.

This also tells us when the Sun never sets: it has to stay above the horizon even at its lowest point, on the opposite side of the sky from noon, which happens when δ90ϕ. Since the Sun's declination maxes out at ϵ=23.4, the midnight sun is only possible above ϕ9023.4=66.6 - and right at that latitude, only on the summer solstice itself. Same (or the opposite) with the Southern hemisphere during its summer. These are the polar circles.

Sun vs Horizon

The Sun will peak at noon but what about a few hours either side of noon? Let's calculate the Sun's altitude throughout the day. To do that, we'll need to use the spherical law of cosines.

Spherical Law of Cosines

This follows the derivation presented in here. I've LaTeX'd the equations, redone the illustrations and streamlined the normalisation step (since I assume a unit sphere to begin with).

Let's take V to be the center of any sphere of radius R and let's draw 3 points A, B, C on the surface of the sphere.

We have |VA|=|VB|=|VC|=R. For simplicity we'll take R=1 but this won't matter since one can normalise the vectors first.

The arclength of each side is a, b and c.

Diagram of 3 points on the celestial sphere

We want to find the angle A between the planes BVA and CVA. We can find the normals to each plane and then calculate the dot product between them. That will give us the cosine of the angle we want. x is the normal to the BVA plane, y is the normal to the CVA plane.

x=VA×VBy=VA×VC

Since the arc AB has length c and the arc AC has length b, the magnitudes of the two normals are

|x|=|VA×VB|=sin(c),|y|=|VA×VC|=sin(b)

so the dot product gives us the cosine of our angle: (VA×VB)(VA×VC)=sin(c)sin(b)cos(A).

Now using the cross product identity:

(VA×VB)(VA×VC)=VA[VB×(VA×VC)]

VA[VB×(VA×VC)]=VA[VA(VBVC)VC(VAVB)]

VA[VA(VBVC)VC(VAVB)]=(VBVC)(VAVC)(VAVB)

(VBVC)(VAVC)(VAVB)=cos(a)cos(b)cos(c)

And we end up with: cos(a)cos(b)cos(c)=sin(b)sin(c)cos(A)

and so

cos(a)=cos(b)cos(c)+sin(b)sin(c)cos(A)

Spherical triangle diagram

We take A to be the north celestial pole, B to be our zenith and C to be the position of the Sun. Matching the diagram, we refer to A as P, B as Z and C as S. The sides of this triangle are:

  • a=ZS, the angle from our zenith to the Sun - the one we are looking for
  • b=PS, the angle between the celestial pole and the Sun; since declination is measured from the celestial equator this is 90δ
  • c=PZ, the angle between the pole and the zenith: 90ϕ where ϕ is our latitude

The angle at the pole (the A in the law) is the hour angle H: how far the Sun is from our meridian, advancing 15 per hour from local solar noon.

Plugging into the law and using cos(90ϕ)=sin(ϕ) and cos(90δ)=sin(δ) (and the same for the sines) we get:

cos(a)=sin(ϕ)sin(δ)+cos(ϕ)cos(δ)cos(H)

Note that a is measured from the zenith and we usually want the opposite - the altitude above the horizon h=90a, which satisfies

sin(h)=sin(ϕ)sin(δ)+cos(ϕ)cos(δ)cos(H)

As a sanity check: Manchester (ϕ53.5) at noon on the June solstice (δ=23.4, H=0) gives h=90(53.523.4)60.

Some interesting things to look at:

  • the poles - they get 6 month days, 6 month nights
  • the polar circles around 66-67 degrees north and south
  • the tropics around 23 degrees north and south
  • some of the preset cities I put on there

Overhead Ecliptic

The Sun is one thing - what about the ecliptic in general? You'll notice that in the picture the ecliptic is pretty much exactly overhead - at night, possibly close to but definitely before sunrise.

The angle that the ecliptic makes with the horizon will differ throughout the day: the tilt between the celestial equator (i.e. Earth's equator projected out onto the sky) and the ecliptic causes a "wobble" as the Earth rotates. Let's see how we can calculate it based on time of day; then we can work out approximately when the picture was taken.

Also, this was very confusing to me at first. To take a very specific example, let's pretend we're in Manchester, near 53N. Our peak ecliptic angle will be about 60.4 (90(5323.4)). 6 months later, we'll get the same peak angle, it'll just happen at night. In other words - we go through the full cycle every single day, and the time of year only decides how that cycle lines up with the Sun being on the "day" side.

Here are two visualizations. The first one is an Earth view at different days of the year and different times of the day. There are two different perspectives: the first one locks the observer in place (zenith always points up) and rotates the rest accordingly. The second one locks the ecliptic and rotates the observer.

Personally I find the fixed ecliptic perspective a bit easier to reason about than the fixed observer.

The second is a graph of this ecliptic vs horizon angle throughout the year.

Derivation

The Sun's position can be easily expressed in the ecliptic frame. We take the line of the Vernal Equinox to be our x-axis. The z-axis is the normal to the ecliptic plane. The y-axis is defined by the right-hand rule from the x and z axes. Note the z component is always 0 (since the Sun lies ON the ecliptic); we just have the λ longitude as a parameter.

Ecliptic longitude is calibrated so that λ=0 at the vernal equinox. The vernal equinox falls around March 20-21, which is day-of-year 80 (31+28+21=80 in a non-leap year). Subtracting 80 re-zeroes the day count so that N=80λ=0, with λ increasing at the mean rate from there. Without this offset, N=1 (Jan 1) would be incorrectly assigned λ=0, when the sun is actually already about 280 around the ecliptic from the equinox point by that date.

There's also the equatorial frame.

Both coordinate systems share an origin (Earth) and share the same reference direction for their zero-point - the vernal equinox, which is defined as the intersection of the ecliptic and equatorial planes. They differ only by a rotation of angle ϵ about that shared axis (the x-axis).

We have the Sun's position as:

(xeclyeclzecl)=(cosλsinλ0)

Fixed geometry of the ecliptic pole

Earth's axial tilt ϵ=23.44

The north ecliptic pole (NEP) sits at a fixed spot on the sky. δNEP=90ϵ=66.56,αNEP=270

Sun's mean ecliptic longitude

For day of year N:

λ(N)=(N80)360365.25

Ecliptic-to-equatorial coordinate transformation

Step 1 - sun's position vector in ecliptic coordinates. Take the Sun's position vector from before.

Step 2 - rotate by ϵ about the x-axis using the standard rotation matrix:

(xeqyeqzeq)=(1000cosϵsinϵ0sinϵcosϵ)(cosλsinλ0)=(cosλsinλcosϵsinλsinϵ)

The x-component is untouched by the rotation - rotating about an axis never changes a vector's own component along that axis (e.g. spinning a globe about its polar axis leaves every point's latitude unchanged). Only y and z mix into each other.

Step 3 - compare coordinate by coordinate against standard spherical coordinates xeq=cosδcosα, yeq=cosδsinα, zeq=sinδ:

cosδcosα=cosλ

cosδsinα=sinλcosϵ

sinδ=sinλsinϵ

The third equation directly gives the sun's declination for the year:

δ(N)=arcsin(sinλ(N)sinϵ)

Step 4 - solve for α. Dividing the second equation by the first eliminates the unknown cosδ:

tanα=sinλcosϵcosλ

(One implementation note: a plain arctan only returns values in (90,90), so for half the year it puts α in the wrong quadrant. In code you want atan2 of the numerator and the denominator.)

Local Sidereal Time

As a function of clock hour t and day of year N (I'm avoiding h since that's already taken by the altitude):

LST(t,N)=α(N)+(t12)15

Note that at t=12 we get LST(t,N)=α(N).

Hour angle of the ecliptic pole

H(t,N)=LST(t,N)αNEP

The angle the ecliptic makes with the horizon

The key geometric fact: the angle at which two great circles cross equals the angular distance between their poles.

The horizon is a great circle whose pole is the zenith Z. The ecliptic is a great circle whose pole is the north ecliptic pole (NEP). So the ecliptic-horizon angle is just the angular separation d between Z and the NEP - we never need the intersection points themselves.

(The ecliptic meets the horizon at two points, where it rises and where it sets. The interior angle is d at one and 180d at the other, since they are supplementary.)

Setting up the spherical triangle

We get d from the spherical law of cosines on the triangle with vertices:

  • the north celestial pole (NCP) - the apex,
  • the zenith Z,
  • the north ecliptic pole (NEP).

We do the same as before: set up a spherical triangle, except we swap the Sun for the NEP.

The two sides meeting at the NCP are co-declinations:

NCPZ:90δZ=90L,NCPNEP:90δNEP=ϵ

using δZ=L (a zenith's declination equals the observer's latitude - L here is the ϕ from before) and δNEP=90ϵ.

The angle at the NCP is the difference in hour angles. The zenith is always on the meridian (hour angle 0); the NEP's hour angle is H. So the apex angle is H. The side opposite the NCP, joining Z and the NEP, is d:

cosd=sinLsinδNEP+cosLcosδNEPcosH

and d is the ecliptic-horizon angle.

Sanity checks

  • North Pole (L=90): cosd=sinδNEP=cosϵ, so d=ϵ, independent of H. Correct - at the pole the horizon is the celestial equator, so the ecliptic always meets it at the obliquity.
  • Equator (L=0): cosd=sinϵcosH, which swings with H as the ecliptic pinwheels around the sky.

Back to the picture

Lat-Lon grid near San Pedro, Chile
I know there's metadata for this picture on Wikimedia - but for the sake of the below pretend that we're pulling a Sherlock Holmes.
Now let's return to the original photograph. The picture was taken in Chile, close to 23 south, almost directly on the Tropic of Capricorn. Let's try working backwards to see when this picture was taken.

First, why is a picture like this possible at all? For the ecliptic to pass overhead, the zenith has to lie on the ecliptic - i.e. the zenith-to-NEP distance d has to hit exactly 90. Setting cosH=±1 in our formula shows that over a day cosd swings between sin(Lϵ) and sin(L+ϵ), so d=90 is only reachable when |L|ϵ: in the tropics. Our photographer sits at |L|ϵ, right on the boundary, where the ecliptic just grazes the zenith once a day.

Now for the when. Take L=ϵ and set d=90 in

cosd=sinLsinδNEP+cosLcosδNEPcosH

Plugging in sinδNEP=cosϵ and cosδNEP=sinϵ:

0=sinϵcosϵ+cosϵsinϵcosHcosH=1H=0

So the ecliptic is overhead exactly when the NEP crosses our meridian, i.e. when LST=αNEP=270.

The picture looks like deep pre-dawn - call it 3:30 am. From our LST formula:

α=LST(t12)15=270(3.512)15=397.537.5

Inverting tanα=sinλcosϵ,/cosλ gives tanλ=tanα/cosϵ, so λ40. And finally the day of year:

N=80+40365.25360121

Day 121 is the very start of May.

Time to check our deduction against the metadata: the picture shows the Eta Aquariids, a meteor shower that peaks around the 5th of May.

Wrapping up

So that's the digest of the "obvious": the tilt ϵ gives the Sun its yearly declination swing, which sets the seasons, the sunrise directions, the tropics and the polar circles. One application of the spherical law of cosines gives the Sun's altitude at any hour; another one - with the Sun swapped for the ecliptic pole - gives the angle the whole ecliptic makes with the horizon.

The Moon is another topic for another day.


  1. Or close enough to it ↩︎