Others view: Welcome ♦ 2D Fast Fourier Transform ♦ Sequence alignment ♦ rss.xml ♦ Dynamic programming table ♦ Forum and issue tracker ♦ Fungal morphogenesis ♦ Four Russians (algorithm) ♦ Lissajous curves ♦ search ♦

here:

- is the sun declination.
- is the latitude of the observer
- is the time, expressed in degrees (with 24 hours corresponding to 360 degrees). Take negative value for sunset and positive value for sunrise.

An object has a declination 0° on the (celestial) equator, +90° at the north pole and −90° at the south pole. The Sun's declination is approximately equal to^{[2]}

where -23.45 is the axial tilt of the earth. N is the number of the days elapsed after the 1 of January that year.

There are also various more complex, but also more precise formulas. For instance, the same source gives the formula

where

is the day angle (fractional year) in radians.

Changes of the declination over year give the raise of seasons.

Given formulas compute the sunrise and sunset times in the vacuum (if it would be in the Moon). For more precise output, refraction in the Earth's atmosphere must also be taken into consideration:

where *a* is the altitude of the centre of the solar disc in angular units (about 0.83°)

^{1 }Wikipedia on Sunrise Equation^{2 }Desmond Fletcher (2007) Solar Declination