Every latitude on Earth has its own yearly pattern of daylight. We show that this pattern follows from one simple geometric observation: daylight is just the fraction of a latitude circle lying on the illuminated side of Earth. From that idea alone we can derive the sunrise equation using intuitive geometry and linear algebra.

What makes a day?

A day is one full rotation of the planet. While we think of "days" as cycles of daylight and darkness, days have nothing to do with sunshine; in the extreme latitudes of the world, there are many days per year with no Sun at all! On the other side of the spectrum, there are entire days where the Sun never sets in polar regions. We call these phenomena "Polar Night" and "Midnight Sun".

Polar night in Svalbard. Though it is day time, it is dark out. Midnight Sun in Iceland. The Sun
            nears the horizon but never sets.
(left) The polar night in Nybyen, Svalbard, looks like this photo. While the Sun doesn't rise above the horizon, it does come close to doing so. Instead of the pitch black many imagine it to be like, you get a blue light much of the time during the days of the polar night. Note: the photo wasn’t actually taken during polar night. [via Wikipedia] (right) From Space.com: The midnight sun moving over Sigurdarstadavik Bay near Kopasker, Iceland. [Paul A. Souders via Getty Images]

Most people on Earth have more balanced cycles of daylight and darkness than these extreme polar examples. Perhaps less intuitive is that even across a large city, slight differences in latitude produce measurable differences in daylight! The latitude of a location uniquely determines the day and night cycle.

Three Ideas Behind the Seasons

There are a few fundamental concepts behind the geometry of seasonality.

  1. The Terminator plane: The plane that separates the sunny half and dark half of Earth is called the "Terminator plane". The terminator plane does not care where our North Pole is -- it will always split the Earth in two perfect halves based on which side is facing the Sun. This uneven slicing is the root cause of unbalanced light/dark cycles each day!

    Geometric demonstration of the terminator line. It separates the Earth in 2 sides: light and dark.
    The terminator line separates night and day. It always splits the Earth in half -- whichever half is closest to the Sun gets illuminated.
  2. The North Pole's tilt: The Earth's axis points toward a nearly fixed point in space at approximately 23.5° from the solar plane. This causes uneven Sun exposure over the Earth. While Earth's tilt toward deep space does not change, there is a continuous change in relative tilt between the North Pole and the Sun throughout the orbit, driven only by the change in positions!

    Earth orbiting around the Sun. The Earth is shown in 4 configuration of orbit: both equinoxes and both solstices.
    Earth throughout its annual orbit. Since the North Pole points toward one direction in Space, the tilt of the North Pole relative to the Sun changes through the path, causing seasons. The absolute tilt of the Earth does not change, however. (Credit to the National Weather Service)
  3. Earth's rotation and Latitude circles: latitude is the "height" of a location on the globe. Since Earth fully rotates about its axis every 24 hours, you may imagine a city tracing out a circle as it races around its unique orbital path. This latitude circle is shared by every point on the same latitude.

    For instance, both Chicago and Rome have a latitude around 41.8°N , making their latitude circles (and thus seasons) very similar (for those interested, Lisa Muth has a fantastic visualization of cities around the world by latitude here: link).

    A global map. Major cities at similar latitudes have a line connecting them to show their seasonal kinship.
    Cities at the same latitude experience the same sunlight dynamics. Credit: Lisa Muth's blog post.

    The key insight here is this: day and night cycles for a latitude are uniquely determined by the terminator plane's slicing of its daily rotational circle.

    2D, side-on diagram of Earth. The north pole is tilting away from the Sun. It has a ring at a particular latitude, circling the globe. Part of this ring is in the sunny side of earth, but most of it is on the dark side. The terminal splits them.
    Latitude circle visualized. Everything at the latitude shares the daily rotational circle.

The Traditional Sunrise Equation

The equation to compute daylight by latitude has been around for a long time. However, there's a lot to unpack with its interpretation and origins. For a high level idea: the "Sunrise Equation" works by computing the angle covered by Earth's orbit from sunrise to sunset, then converting this angle to hours by using the Earth's 24-hour rotational period to go from angle to time.

Wikipedia has great visualizations on the topic. Its derivation begins from astronomical coordinate systems which, in my opinion, are hard to understand without "learning the language" of astronomers.

The key article is that of the "Sunrise equation". It details the geometric formula (approximate), some correction terms, and the consequences of the equation. For instance, they apply this equation to every latitude on Earth to form a really nice heatmap of the hours of daylight over the year, by location.

Heatmap showing the hours of sunlight per day at each latitude
Heatmap showing the hours of sunlight per day at each latitude. Note the edge cases: consistent 12 hours of sunlight at the equator, with alternating periods of 24 or 0 hours of Sun at (Ant)Arctic Circle. [via Wikipedia]

There are a few interesting traits of this plot. First, the North and South polar regions have pronounced periods of no daylight and full daylight -- the "midnight sun" and "polar night" periods of the year.

Nearing the equator, you get balanced cycles of daylight and darkness (in fact, there's a symmetry about the Equator which makes the Northern Hemisphere and Southern Hemisphere mirror each other, "taking turns" in opposing seasons).

No surprise that origin of the word "Equator" is Latin for, "...equalizer (of day and night)..."! [source]

The Traditional Approach Hides Intuition

The domain-specific knowledge of the traditional approach makes it difficult to reason about the actual physical system. Here's Wikipedia's formulation:

The time at which a celestial object crosses the horizon can be calculated by converting its coordinates from the equatorial coordinate system to the horizontal coordinate system, and then solving the equation for an altitude of zero. We then obtain:

$$ cos{H_0}=-\tan\phi\,\tan\delta $$

where:

  • \(H_0\) is the solar hour angle at sunrise (negative) or sunset (positive).
  • \(\phi\) is the latitude of the observer.
  • \(\delta\) is the Sun's declination.

Celestial geometry isn't easy to begin with, but even by that standard, the presentation could have more detail. For instance, take the solar hour angle: though this is mathematically fine, it assumes familiarity with astronomical coordinate systems. It won't be obvious to anyone (but seasoned astronomers) why this should be the right equation. This hides a lot of complexity without an easy path to understand the why.

Wikipedia approaches the problem from observational astronomy: when does the Sun cross the horizon?

We'll instead reframe, and ask an adjacent geometric question: what fraction of a latitude circle is on the sunny side of the terminator plane?

An Alternative Approach for Daylight and Seasons

To compute the hours of daylight in a given day, we need to study the intersection of these latitude circles with the terminator plane.

Diagram of Earth and the Sun. The Earth's north pole (axis) point away from the sun. The terminator line is visible. It's clear that the illuminated half of the earth does not have to align with the rotational axis.
The Sun's rays always illuminate half of the Earth. The boundary is called the "Terminator Line" by astronomers. The sunny hours in a given day is just how much time that latitude spends on the sunny side of the boundary.

Over the course of a single day, Earth's position in its orbit changes by less than one degree. For understanding one day's pattern of sunlight, we can treat the Earth's orientation relative to the Sun as fixed. This lets us simplify our mental model by looking at "daily snapshots" of the geometry.

Animation of Earth's pole gradually pointing toward then away from the Sun
Over the course of a year, the Earth's pole will gradually point 23.5° "into", then away from, the terminator due to changes in its relative tilt. The moving arrow symbolizes the daily movement of a city around the Earth. Note: while the Earth does rotate, it does not actually move its North Pole back and forth like this animation. The pole movement is a math trick to simulate the relative tilt shift as Earth moves around the Sun -- they are equivalent. Source

In the morning, a point on Earth will rotate through the Terminator and receive sunlight. In the evening, it will rotate through the opposite side of the terminator, plunging into the darkness.

For computing hours of daylight, the intersection between the terminator and the latitude ring is all that matters. When this intersection exists, the arc near the Sun represents the fraction of daylight, and the fraction away from the Sun is the fraction of darkness. When the intersection does not exist, you have something more special -- 24 hours of sunlight or darkness.

Roughly, the sunlight per day can be written like so:

$$\text{total hours of daylight} = \text{(fraction of orbit illuminated by Sun)} \cdot \text{(24 hours)}$$

Since we want the fraction of the illuminated latitude circle, we need to compute the arc-length on the positive side of the terminator. The arc-length of a circle of unit radius is just the angle itself (so a full circle's arc-length is \( 2 \pi \) ). Assuming we have a way to compute Earth's rotation position at sunrise and sunset, this reduces to a simple fraction:

$$\text{total hours of daylight} = \frac{\theta_{\text{sunset}} - \theta_{\text{sunrise}}}{2\pi} \cdot \text{24 hours}$$

We next make this intuition more precise by constructing a mathematical model.

Building a Geometric Model

Our strategy is simple. First we'll write down the path traced by a point on Earth during one day. Next we'll tilt that path to account for the seasons. Finally, we'll intersect it with the terminator plane. The resulting intersection points are sunrise and sunset.

Choosing Coordinates and Variables

We first need a mathematical description of a point on Earth.

We assume Earth is a perfect sphere in space, centered at the origin with unit radius. The Sun is far away on the X-axis, fully illuminating the half of the Earth exposed to it.

The sphere has a North Pole that provides orientation for this 3D object in space, and an equator at the latitude ring in the center of the planet.

We choose a convention such that the Earth changes tilt in place instead of orbiting, fixing the Sun in place along the x-axis. We can simulate the relative tilt changes of orbit by applying rotations to our model Earth.

  • Latitude, \( \lambda \): We use the same convention as real latitudes, using values from [-90, 90]°. This angle is measured from the equator of the sphere, where angles toward the north are positive, and anything south is negative.
  • Relative Tilt (Declination), \( \phi \): The angle measuring how much the Earth is tilting toward or away from the Sun. Formally, the angle between the Earth's North Pole and the Z-axis, measured only in the X-Z plane.
  • Longitude, \( \theta \): Standard angle around the Earth's equatorial lines.
Basic, annotated spherical coordinates diagram. Fairly standard 3D coordinates but with slight customization to match the variable name and domain preferences of the article.
Coordinates are spherical coordinates but with latitude based on the Earth's human-friendly convention (+/- 90°).

Latitude Circles

For now, assume that the Earth has no tilt. A point on Earth at latitude \( \lambda \) traces a circle through all longitudes, \( \theta \), as the Earth rotates.

Diagram of earth enduring sun exposure. There is a ring at its northern latitudes. The half of the ring facing the sun is a brighter color, indicating its arc length in the sun. A free-floating latitude ring diagram. It is a circle in 3D space, abstracting away the latitude circle from the Earth in the neighboring diagram.
Points on Earth each form a ring as they rotate, completing the circle every 24 hours.

Parameterized by longitude angle \( \theta \) and latitude angle \( \lambda \), the position vector can be described with polar/cylindrical coordinates:

$$ \begin{aligned} x &= r\cos\theta = \cos\lambda\,\cos\theta \\ y &= r\sin\theta = \cos\lambda\,\sin\theta \\ z &= z = \sin\lambda \end{aligned} $$
Diagram showing basic coordinates in 3D. A ring is elevated in the z direction, with cylindrical-style annotations of its radius and height.
Polar coordinates with a height (cylindrical coordinates) allow us to easily describe the ring around Earth at latitude \( \lambda \).

To see this, recall that in polar coordinates a point on a circle can be described by its radius and angle. The \( z \) component is just the height of the circle, which comes from the sine of the latitude since we assume radius 1. The results clean up nicely:

$$ \mathbf{r}_0(\theta) = \begin{pmatrix} \cos\lambda\,\cos\theta \\ \cos\lambda\,\sin\theta \\ \sin\lambda \end{pmatrix} $$

Tilting the Earth Relative to the Sun

Our setup assumes the Earth's North Pole always points straight up the z-axis. We need a way to simulate tilting the North Pole.

To account for axial tilt \( \phi \), we write down a standard rotation matrix about \( y \):

$$R_y(\phi) = \begin{pmatrix} \cos\phi & 0 & \sin\phi \\ 0 & 1 & 0 \\ -\sin\phi & 0 & \cos\phi \end{pmatrix}$$

This matrix rotates any set of points in 3D space around the y-axis by angle \( \phi \). It is important because it gives a clear way for us to apply tilts to any part of our 3D model. However, we don't need to rotate our entire model Earth to solve our problem. Rotating the latitude ring alone is sufficient.

The tilted position is the product of the rotation matrix and our position matrix:

$$ \mathbf{r}(\theta) = R_y(\phi)\,\mathbf{r}_0(\theta) $$

Resolving this concretely, we get components:

$$ \mathbf{r}(\theta) = \begin{pmatrix} \cos\phi & 0 & \sin\phi \\ 0 & 1 & 0 \\ -\sin\phi & 0 & \cos\phi \end{pmatrix} \begin{pmatrix} \cos\lambda\,\cos\theta \\ \cos\lambda\,\sin\theta \\ \sin\lambda \end{pmatrix} $$

expanding:

$$ \begin{aligned} x &= \cos\phi(\cos\lambda\,\cos\theta) + \sin\phi(\sin\lambda) \\ y &= \cos\lambda\,\sin\theta \\ z &= -\sin\phi(\cos\lambda\,\cos\theta) + \cos\phi(\sin\lambda) \end{aligned} $$

This is the equation of the tilted latitude circle, for any axial tilt relative to the Sun!

Latitude ring diagram where the earth has no tilt. The ring is equally illuminated (like an equinox). Latitude ring diagram where the earth is tilting away from the Sun. The latitude ring has very little sun exposure due to extreme relative tilt.
Same latitude circle, viewed with and without tilt. Note the substantial decrease in Sun exposure for the latitude ring after tilting (orange part of the latitude ring).

The rotation operator allows us to simulate all of the configurations necessary to study seasonality.

The Terminator Condition

We created a 3D mathematical model of the tilting Earth for a specific reason: we want to know, for a specific tilt and location, "how much daylight do you get?"

The final step is to find how much of the ring is in the sunlit half of the Earth.. Intersection with the terminator plane gives us just that.

In our coordinates, the Sun lies far away on the positive x-axis. By definition, the terminator occurs at \( x = 0 \), so -x values will always be dark, and +x values are always sunlit. Daylight requires \( x > 0 \) . However, as we saw earlier, we only need to compute the sunrise and sunset conditions to understand daylight.

To get sunrise and sunset, we can set \( x = 0 \) from the rotated latitude coordinates and rearrange:

$$\cos\phi\,\cos\lambda\,\cos\theta + \sin\phi\,\sin\lambda = 0$$ $$\cos\theta = \frac{-\sin\phi\,\sin\lambda}{\cos\phi\,\cos\lambda}$$ $$\cos\theta = -\tan\phi\,\tan\lambda$$

Attentive readers may notice this is the exact equation that Wikipedia gave under the name the "Sunrise Equation"! Since the angle \( \theta \) sweeps out longitude values, solutions for \( \theta \) give sunrises and sunsets -- exactly the equation's namesake!

Computing the Length of a Day

We want \( \theta \) values to evaluate the hours of daylight expression:

$$\text{total hours of daylight} = \frac{\theta_{\text{sunset}} - \theta_{\text{sunrise}}}{2\pi} \cdot \text{24 hours}$$

To start, we can appeal to symmetry to simplify the difference in sunrise and sunset angles. The illuminated arc will always be cut in half by the x-axis. Therefore, if we measure our \( \theta \) from this point, the angle from the origin to sunrise is the same as the angle from the origin to sunset. The following identity must be true:

$$\theta_{\text{sunset}} - \theta_{\text{sunrise}} = 2\theta$$

Plugging back in to our primitive sunlight equation,

We want to evaluate this: $$\text{total hours of daylight} = \frac{\theta}{\pi} \cdot \text{24 hours}$$ And we know the following relationship: $$\cos\theta = -\tan\phi\,\tan\lambda$$

However, the inverse cosine is not always defined!

$$\theta = \cos^{-1}(-\tan\phi\,\tan\lambda)$$ valid only when: $$ |\tan\phi\,\tan\lambda| \leq 1 $$

What does this mean? \( \phi \) is the relative tilt of the Earth with respect to the Sun, and \( \lambda \) is the latitude. When the tilt and latitude simultaneously reach extreme values, the equation no longer gives sunrise and sunset!

Latitude ring visualized. The entire latitude ring is behind the terminator, avoiding sunlight. Latitude ring visualized. The entire latitude ring is in front of the terminator, getting only sunlight.
Polar extremes of "Polar Night" and "Midnight Sun". Extreme latitude and aggressive tilt force the entire latitude's ring onto one side of the day/night boundary.

This has a direct physical interpretation. We know there are three cases for a latitude day cycle:

  • Normal day: The path is partially illuminated
  • Edge case: The path is fully illuminated (midnight sun)
  • Edge case: The path is not illuminated at all (polar night)

We want to either find the intersection to extract \( \theta \), or classify the solution as one of the 2 edge cases if there is no solution. Finally, a piecewise function cleanly explains the cases!

$$ \text{hours of daylight} = \begin{cases} 24, & \tan\phi\,\tan\lambda \geq 1 \quad \text{(midnight sun)} \\[8pt] \dfrac{24}{\pi}\cos^{-1}(-\tan\phi\,\tan\lambda), & -1 < \tan\phi\,\tan\lambda < 1 \\[8pt] 0, & \tan\phi\,\tan\lambda \leq -1 \quad \text{(polar night)} \end{cases} $$

From Geometry to Calendar

The piecewise equation tells us that, if we know our latitude and tilt relative to the Sun, we can confidently compute the amount of sunlight in a day. Latitude is somewhat easy to know, but the tilt is actually something empirical.

Tilt oscillates between +23.5° and -23.5°, from solstice to solstice. Relative tilt is roughly sinusoidal at the same frequency as Earth's yearly orbit around the Sun. We will not go into the details, but you can imagine reverse-engineering this with primitive tools. Ancient people logged the length of days and geometry of shadows at their sundials (see Gnomon). Such log books remain consistent year-over-year. It is entirely possible to get as far as we did with basic tools.

Wikipedia's article on "Position of the Sun" gives the following declination (relative tilt) approximation:

$$ \phi (N) = -23.44^\circ \cdot \cos\lbrack{\frac{360}{365}(N + 10)}\rbrack $$

where "N" is the day of the year, and "N=0" is January 1st. After converting the results to radians, this plugs directly into our sunlight equation for a full, annual approximation.

$$ \phi (N) = -23.44^\circ \cdot \frac{\pi}{180^\circ} \cdot \cos\lbrack{\frac{360}{365}(N + 10) \frac{\pi}{180^\circ}}\rbrack $$
Many overlayed line plots showing the hours of sunlight per day over a year, for many cities on Earth.
Our equations allow us to reproduce Wikipedia's heatmap results for some sampled cities.

I took the liberty of plugging in some cities at various latitudes. Comparing to the original Wikipedia heatmap, I am pleased to see the same interesting features emerge: we have seasons, symmetry between north and south hemisphere cities, flattening close to the equator, and even the midnight sun! For the smooth part of the curve, you can even see that the derivative of hours of daylight with respect to time is dramatic as you approach the poles! Have you ever stopped to think that a friend up north gained more sunlight today than you did? It had never crossed my mind!

Limits of the Approximation

The real world is complex. Our simplifying assumptions get us close but there are a few factors we'd correct for to make this approximation better. To name a few key differences,

  • The Earth's atmosphere refracts sunlight. You can see the Sun before it is over the horizon.
  • Earth's orbit is not a perfect circle. For accurate day-by-day sunlight forecasts, it's better to formulate the tilt factor as an elliptical function aligned with real data.
  • The Earth is not a perfect sphere. Some call it a "flattened" sphere. Spherical geometry gets us pretty close though.
More accurate diagram of Earth's orbit, showing elliptical behavior.
Exaggerated illustration of Earth's elliptical orbit around the Sun, marking that the orbital extreme points (apoapsis and periapsis) are not the same as the four seasonal extreme points (equinox and solstice) [Wikipedia]

There are known correction factors and plenty of empirical results to fine-tune the approximation further. Despite these simplifications, the model captures the dominant geometric effect remarkably well.

Final Thoughts

As we live through the seasons, nature's changing face reminds us that we are hurtling through space, only to fall back into the same rhythmic dance of gravity. You can imagine being an early astronomer, using a local record of solstices and equinoxes to create your own seasonal daylight map. I then wonder, with all of today's advanced technological miracles, how much of it is built on the shoulders of those who listened to nature's whisper?

Sources