I'm looking for a reasonably straightforward derivation of the sunrise equation$$\cos\omega=-\tan\phi\tan\delta$$as referenced in the Wikipedia article here. I've dipped into Astronomical Algorithms by Jean Meeus, where the formula is given on page 101. However, as far as I can see, the only explanation Meeus gives is by setting $h=0$ in his earlier equation 13.6, which he simply states as if obvious. I've also found an online paper called Derivation of Solar Position Formulae by Ross Ure Anderson, where there is a fuller derivation (starts on page 11), but which I'm having trouble following.

  • $\begingroup$ Would you mind specifying what $h$ is? My guess is it's the elevation, but it would be nice to know for sure. Also, at what point would you like the derivation to start? It's not tricky to figure out if you can start from the conversion formulae between equatorial coordinates and local coordinates (i.e. azimuth and elevation). $\endgroup$
    – HDE 226868
    Commented Jul 10, 2021 at 19:46
  • $\begingroup$ @HDE226868 - His equation 13.6 is $\sin h=\sin\phi\sin\delta+\cos\phi\cos\delta\cos H$, where $h$ is “altitude, positive above the horizon, negative below.” $H$ is the local hour angle ($\omega$ in the Wikipedia equation). $\endgroup$
    – Peter
    Commented Jul 10, 2021 at 20:21

1 Answer 1


We can start by converting between equatorial coordinates (right ascension $\alpha$ and declination $\delta$) to horizontal coordinates (azimuth $\text{Az}$ and elevation/altitude $a$). If you want to go past this, feel free to skip to the end. We draw a spherical triangle on the sky, with the three points being the object of interest at a given point $X$, the north celestial pole $P$, and the zenith angle of the observer $Z$. Just by the definitions of elevation and declination, you should be able to see that the distance between $X$ and $Z$ is $90^{\circ}-a$ and the distance between $X$ and $P$ is $90^{\circ}-\delta$. The distance between $P$ and $Z$ is then $90^{\circ}-\phi$, with $\phi$ the latitude of the observer. Here's a nice diagram showing the geometry:

enter image description here
Image credit: Fiona Vincent, University of St. Andrews.

The angle between $PZ$ and $PX$ is the hour angle, $H$. We can plug all of the above into the spherical law of cosines to get $$\cos(90^{\circ}-a)=\cos(90^{\circ}-\delta)\cos(90^{\circ}-\phi)+\sin(90^{\circ}-\delta)\sin(90^{\circ}-\phi)\cos(H)$$ or $$\sin a=\sin\delta\sin\phi+\cos\delta\cos\phi\cos H$$ which is the formula you say Meeus gave. Now, at sunrise or sunset, the Sun appears at the horizon, meaning it has an elevation of $a=0$; that's just the definition of the horizon and any object on it. This in turn means that $\sin a=0$, so our equation becomes $$0=\sin\delta\sin\phi+\cos\delta\cos\phi\cos H\implies-\sin\delta\sin\phi=\cos\delta\cos\phi\cos H$$ Rearranging this gives $$\cos H=-\tan\delta\tan\phi$$ as requested.

  • $\begingroup$ I know zilch about astronomy, but came upon the sunrise equation the other day and found it intriguing. It never crossed my mind the thing would be derived from the conversion of two coordinate systems, which is rather neat. Thanks. $\endgroup$
    – Peter
    Commented Jul 11, 2021 at 8:26
  • 1
    $\begingroup$ That's a first approximation. Sunrise comes earlier than that and sunset later because of refraction and the size of the solar disk. Calculating H is also trickier because of the equation of time. The wikipedia article, near the end, discusses some of the complexities. $\endgroup$
    – stretch
    Commented Jul 13, 2021 at 12:09

You must log in to answer this question.

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