# Sunrise equation

A contour plot of the hours of daylight as a function of latitude and day of the year, using the most accurate models described in Sunrise equation, Latitude 40° N (approximately New York City, Madrid and Beijing) is highlighted for reference

The sunrise equation as follows can be used to derive the time of sunrise and sunset for any solar declination and latitude in terms of local solar time when sunrise and sunset actually occur:

${\displaystyle \cos \omega _{\circ }=-\tan \phi \times \tan \delta }$

where:

${\displaystyle \omega _{\circ }}$ is the hour angle at either sunrise (when negative value is taken) or sunset (when positive value is taken);
${\displaystyle \phi }$ is the latitude of the observer on the Earth;
${\displaystyle \delta }$ is the sun declination.

## Theory of the equation

The Earth rotates at an angular velocity of 15°/hour. Therefore, the expression ${\displaystyle \omega _{\circ }\times {\frac {\mathrm {hour} }{{15}^{\circ }}}}$ gives the interval of time before and after local solar noon that sunrise or sunset will occur.

The sign convention is typically that the observer latitude ${\displaystyle \phi }$ is 0 at the Equator, positive for the Northern Hemisphere and negative for the Southern Hemisphere, and the solar declination ${\displaystyle \delta }$ is 0 at the vernal and autumnal equinoxes when the sun is exactly above the Equator, positive during the Northern Hemisphere summer and negative during the Northern Hemisphere winter.

The expression above is always applicable for latitudes between the Arctic Circle and Antarctic Circle. North of the Arctic Circle or south of the Antarctic Circle, there is at least one day of the year with no sunrise or sunset. Formally, there is a sunrise or sunset when ${\displaystyle -90^{\circ }+\delta <\phi <90^{\circ }-\delta }$ during the Northern Hemisphere summer, and when ${\displaystyle -90^{\circ }-\delta <\phi <90^{\circ }+\delta }$ during the Northern Hemisphere winter. Out of these latitudes, it is either 24-hour daytime or 24-hour nighttime.

## Generalized equation

Also note that the above equation neglects the influence of atmospheric refraction (which lifts the solar disc by approximately 0.6° when it is on the horizon) and the non-zero angle subtended by the solar disc (about 0.5°). The times of the rising and the setting of the upper solar limb as given in astronomical almanacs correct for this by using the more general equation

${\displaystyle \cos \omega _{\circ }={\dfrac {\sin a-\sin \phi \times \sin \delta }{\cos \phi \times \cos \delta }}}$

with the altitude (a) of the center of the solar disc set to about −0.83° (or −50 arcminutes).

## Complete calculation on Earth

The generalized equation relies on a number of other variables which need to be calculated before it can itself be calculated. These equations have the solar-earth constants substituted with angular constants expressed in degrees.

### Calculate current Julian day

${\displaystyle n=J_{date}-2451545.0+0.0008}$

where:

${\displaystyle J_{date}}$ is the Julian date;
${\displaystyle n}$ is the Julian day since Jan 1st, 2000 12:00.
0.0008 is the fractional Julian Day for leap seconds and terrestrial time.
currently = 68.184 / 86400 without DUT1.

### Mean solar noon

${\displaystyle J^{\star }={\dfrac {l_{w}}{360^{\circ }}}+n}$

where:

${\displaystyle J^{\star }}$ is an approximation of mean solar time at ${\displaystyle l_{w}}$.
${\displaystyle l_{\omega }}$ is the longitude west (west is positive, east is negative) of the observer on the Earth;

### Solar mean anomaly

${\displaystyle M=(357.5291+0.98560028\times J^{\star })\mod 360}$

where:

M is the solar mean anomaly.

### Equation of the center

${\displaystyle C=1.9148\sin(M)+0.0200\sin(2M)+0.0003\sin(3M)}$

where:

C is the Equation of the center.

### Ecliptic longitude

${\displaystyle \lambda =(M+C+180+102.9372)\mod 360}$

where:

λ is the ecliptic longitude.
102.9372 is a value for the argument of perihelion.

### Solar transit

${\displaystyle J_{transit}=2451545.5+J^{\star }+0.0053\sin M-0.0069\sin \left(2\lambda \right)}$

where:

Jtransit is the hour angle for solar transit (or solar noon).
${\displaystyle 0.0053\sin M-0.0069\sin \left(2\lambda \right)}$ is a simplified version of the equation of time.

### Declination of the Sun

${\displaystyle \sin \delta =\sin \lambda \times \sin 23.44^{\circ }}$

where:

${\displaystyle \delta }$ is the declination of the sun.

### Hour angle

This is the equation from above with corrections for astronomical refraction and solar disc diameter.

${\displaystyle \cos \omega _{\circ }={\dfrac {\sin(-0.83^{\circ })-\sin \phi \times \sin \delta }{\cos \phi \times \cos \delta }}}$

where:

ωo is the hour angle from the observer's zenith;
${\displaystyle \phi }$ is the north latitude of the observer (north is positive, south is negative) on the Earth.

For observations on a sea horizon an elevation-of-observer correction, add ${\displaystyle -1.15^{\circ }{\sqrt {\text{elevation in feet}}}/60^{\circ }}$, or ${\displaystyle -2.076^{\circ }{\sqrt {\text{elevation in metres}}}/60^{\circ }}$ to the -0.83° in the numerator's sine term. This corrects for both apparent dip and terrestrial refraction. For example, for an observer at 10,000 feet, add (-115°/60°) or about -1.92° to -0.83°.

### Calculate sunrise and sunset

${\displaystyle J_{set}=J_{transit}+{\dfrac {\omega _{\circ }}{360^{\circ }}}}$
${\displaystyle J_{rise}=J_{transit}-{\dfrac {\omega _{\circ }}{360^{\circ }}}}$

where:

Jset is the actual Julian date of sunset;
Jrise is the actual Julian date of sunrise.