I would like to calculate the distance between sunrise and sunset along a parallel of latitude, e.g., 45 degrees north.

What I've done is: Earth's circumference at the equator is 40075 km.

Earth's circumference at 45 degrees north is: $40075 \times \cos(45°) = 28337$ km

The distance between sunrise and sunset at the equinox (ignoring refraction) is simply: $28337 / 2 = 14168$ km.

But, what is this distance when the solar declination is other than 0? I.e., the same latitude during summer or winter solstice?

Is there some calculator, which could do it for me, or at least some references?

  • $\begingroup$ I'm not sure I agree with your calculation. You seem to be measuring along the horizontal from east to west. But the distance is normally defined as the great circle distance, which is substantially less. The great circle distance would be via the pole and about 10000km $\endgroup$
    – James K
    Mar 14 at 21:16
  • $\begingroup$ Why do you want the distance along the latitude circle, rather than the angle, or time? BTW, your latitude circumference calculation is for a sphere, the ellipsoid distance is slightly larger. Here's a calculator, in Python, giving the sphere & ellipsoid circumferences. $\endgroup$
    – PM 2Ring
    Mar 15 at 2:50
  • 1
    $\begingroup$ sagecell.sagemath.org/… $\endgroup$
    – PM 2Ring
    Mar 15 at 2:50
  • 1
    $\begingroup$ FWIW, here's a plot of the daylight length at 45°N, 0°E, both with & without refraction. The "no refrac" graph is for the Sun centre on the horizon. My calculated sunrise/set times are generally within a second or so of the values from JPL Horizons. i.sstatic.net/FSgJe.png $\endgroup$
    – PM 2Ring
    Mar 15 at 2:57
  • $\begingroup$ @JamesK The distance between sunrise and sunset on the same latitude is only a great circle through the pole exactly on equinox dates. On other dates the great circle does not cross the poles. $\endgroup$ Mar 15 at 10:57

1 Answer 1


We can use the sunrise equation to determine the Sun's hour angle at sunrise & sunset and thence determine the daylight length. The sunrise equation is derived from the solution to the PZX navigation triangle:


where $alt$ is the Sun's altitude above the horizon, $\delta$ is the Sun's declination, $\phi$ is the latitude, and $h$ is the Sun's hour angle, where $h=0$ at solar noon.

Since we're ignoring refraction (and the Sun's angular radius), we set $alt=0$. That is, we define sunrise & sunset to be when the Sun's centre is on the horizon. This gives the simplified sunrise equation:

$$cos(h) = -\tan(\phi)\tan(\delta)$$

That's the hour angle from solar noon to sunrise or sunset, so we need to double $h$ to get the daylight length. And to convert it to hours, we use $2\pi = 24$ hours.

Here's a plot for latitude 45°.

Daylight hours vs declination

To find the arc length along the latitude circle we just multiply the daylight hour angle (in radians) by the radius of the latitude circle. However, the radius of that circle is not simply $R\cos(\phi)$. Instead, we need to use the parametric latitude $\beta$ of the Earth ellipsoid.

The parametric and geodetic latitude are related by $$\tan(\beta) = (1-f)\tan(\phi)$$ where $f=1/298.257223563$ is the flattening of the WGS-84 ellipsoid.

Here's the plot for latitude 45°. Daylight arc length

Here's the plotting script, running on the SageMathCell server. The code is plain Python, apart from the Sage graph plotting function (which is based on matplotlib). The script works on any latitude, but will give warning messages in polar regions for declinations where the Sun doesn't rise, or doesn't set.

  • $\begingroup$ How could I compute the Beta value, as the formula shown on Wikipedia is too difficult for me? $\endgroup$
    – Geographos
    Mar 15 at 11:09
  • $\begingroup$ @Geographos I have the equation for beta in my answer, $$\tan(\beta) = (1-f)\tan(\phi)$$ And my code shows how to compute $\sin(\beta)$ and $\cos(\beta)$. $\endgroup$
    – PM 2Ring
    Mar 15 at 11:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .