How many hours are there between sunrise and sunset? The Earth’s tilt makes this a fun geometry problem…
Hours of daylight at the solstice
Let \(ε\) be the Earth’s tilt, or obliquity. This is the angle between Earth’s axis of rotation \(N\) and the normal to Earth’s orbital plane around the sun, \(O\). At first, let’s assume that the Earth tilts directly toward the sun (or directly away, for \(ε < 0\)). This direct alignment occurs twice a year, at the summer and winder solstices. We can consider seasons later; for now, assume we’re at summer solstice.
In this scenario, the boundary between day and night is a great circle whose angle from the north pole is \(ε\). In the figure below, the view of Earth is aligned to the north pole, so that changing the tilt \(ε\) changes the relative position of the sun.
Now, let \(φ\) be the latitude of a reference point on Earth, so that \(φ = 0\) is on the equator, and \(φ > 0\) is in the northern hemisphere. Looking down on the north pole, we see that the number of daylight hours is determined by the arc length of the circle of latitude which lies outside the shadow of night (indicated in orange).
To find this arc length in terms of \(ε\) and \(φ\), we must find the points of intercept of the circle of latitude with the ellipse defined by the top-down view of the day/night boundary.
Dawn and dusk intercept points
Assuming that the Earth is the unit circle, the circle of latitude has radius \(\cos φ\), and the day/night ellipse has horizontal radius \(\sin ε\) and unit vertical radius. Parametrically, the ellipse is represented as
\[(x, y) = (\sin ε \cos λ, \sin λ), λ ∈ [0, 2π) .\]This intercepts the circle when the length of the vector \((x, y)\) is the circle’s radius, \(\|(x, y)\| = \cos φ\). Squaring this, we get the intercept condition
\[\sin^2 ε \cos^2 λ + \sin^2 λ = \cos^2 φ\]which, using \(\cos^2 λ = \frac12(1 + \cos 2λ)\) and \(\sin^2 λ = \frac12(1 - \cos 2λ)\), is the same as
\[1 + \sin^2ε + (\sin^2 ε - 1)\cos 2λ = \cos^2φ .\]Solving for the parameter value \(λ\), we get
\[\cos 2λ = \frac{2\cos^2φ - \sin^2 ε - 1}{\sin^2 ε - 1} = 2 \left( \frac{\sin^2 φ}{\cos^2 ε} \right) - 1\]where we use \(\cos^2 θ + \sin^2 θ = 1\) twice to simplify. Instead of solving directly for \(λ\) here, note that the right-hand side matches the identity \(\cos 2λ = 2\cos^2 λ - 1\), so we must have
\[\cos λ = \frac{\sin φ}{\cos ε} .\]Inverting this in generality gives us
\[λ = ±\arccos\left(\frac{\sin φ}{\cos ε}\right) + 2nπ\]for some \(n ∈ ℤ\). If we take just the positive value for \(n = 0\) then we have \(λ ∈ [0, π]\), since this is the conventional range of \(\arccos\). This means our intercept point \((x, y) = (\sin ε \cos λ, \sin λ)\), shown by the highlighted dot, always falls in the upper half-plane:
This is one of four possible intercepts, but it’s the one we want: when \(εφ > 0\), the intercept is in the first quadrant, and when \(εφ < 0\) it is in the second, which is consistent with out three-dimensional picture of Earth, where the intercept we want depends on which hemisphere we’re in.
We’re almost done, but the parameter value \(λ\) isn’t the actual polar angle of the intercept point — we need that to find the arc length which lies in daylight. The polar coordinate \(θ\) of the intercept point \((x, y)\) is
\[θ = \arctan\left(\frac{y}{x}\right) = \arctan\left(\frac{\sinλ}{\sin ε \cos λ}\right) = \arctan\left(\frac{1}{\sin ε} \tan λ\right) .\]The arc length is thus twice this angle, \(2θ\), while the total circumference is \(2π\). Therefore, written in full, the fraction of the day in daylight is
\[L = \frac1π\arctan\left(\frac{1}{\sin ε} \tan \left[\arccos\left(\frac{\sin φ}{\cos ε}\right)\right]\right) .\]Incorporating seasons
In reality, the Earth’s tilt is not exactly toward or away from the sun, because it orbits the sun while its titled axis of rotation remains fixed.
At the northern summer solstice, the north pole is tilted toward the sun. Let \(ω\) be the angle of the Earth’s course around the sun from this point.
Looking down the axis the orbital plane, \(O\), with the sun always to the right, we see the north pole trace out a circle as \(ω\) varies over the course of a year.
The Earth’s obliquity \(ε_0\) remains fixed (the angle of the dashed green arc). However, the true angle the north pole makes from the day–night boundary (the solid green arc which we called \(ε\) before) varies with \(ω\). This is the seasonal dependence of day length.
Our task now is to find \(ε\) in terms of \(ε_0\) and \(ω\).
The points \(O\), \(N\) and \(P\) form a spherical triangle in which each side is an arc of a great circle. To find \(ε\) (the angle of the arc \(\overline{PN}\)) we may use the spherical law of sines:
\[\frac{\sin a}{\sin A} = \frac{\sin b}{\sin B} = \frac{\sin c}{\sin C}\]Specifically, reading off the figure above, this gives us
\[\frac{\sin\overline{PN}}{\sin(\frac{π}{2} - ω)} = \frac{\sin\overline{ON}}{\sin\frac{π}{2}}\]which reduces to
\[\frac{\sin ε}{\cos ω} = \sin ε_0 .\]For completeness, the full expression for the fraction of the day in daylight is
\[L = \frac1π\arctan\left(\frac{1}{\sin ε_0\cosω} \tan \left[\arccos\left(\frac{\sin φ}{\sqrt{1 - (\sin ε_0\cosω)^2}}\right)\right]\right)\]where \(ε_0 = 24.5^\circ\) is the obliquity of the Earth, \(φ\) is the latitude of the reference point and \(ω\) is the season expressed as the arc angle along Earth’s orbit since the solstice.