Physics Stack Exchange is a question and answer site for active researchers, academics and students of physics. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Knowing that astronomical twilight (i.e. astronomical dawn) is when the sun is 18 degrees below the horizon, I am calculating the astronomical twilight time this way:

Sunrise of day1 - [ (Sunrise of day1 - Sunset of day0) / 180° ] * 18°

Is that correct?

share|cite|improve this question

No, that's not correct. Or, rather, it would only be correct on the equator at the equinox, when the sun rises and sets straight up and traces a full great circle across the sky.

Instead, start with the formula for the solar elevation angle $\theta_\mathrm{s}$,

$$\sin \theta_\mathrm{s} = \cos h \cos \delta \cos \Phi + \sin \delta \sin \Phi,$$

and solve for the hour angle $h$ (in the local solar time):

$$\cos h = \frac{\sin \theta_\mathrm{s} - \sin \delta \sin \Phi}{\cos \delta \cos \Phi}$$

where $\delta$ is the current sun declination, $\Phi$ is the local latitude and $\theta_\mathrm{s} = -18^\circ$ (plus a correction for atmospheric refraction, if that's not already included in the 18° figure).

share|cite|improve this answer

With thanks to Ilmari Karonen above, for the guidance provided here, I modified this go library cpucycle/astrotime (on to take account of dawn and dusk calculations (results here ninjasphere/astrotime also on

To test these results, I compared the library outputs with those generated by To reproduce those results, I had to omit the refractive index from the calculations of dawn and dusk. Presumably this is because the definitions of dawn and dusk are based on the actual, rather than apparent, location of the sun and so do not need to take account of refractive index.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.