Declination of the sun is the angle between the equator and a line drawn from Earth to Sun center to center.

The declination angle varies seasonally due to 2 factors — the tilt of the Earth on its axis and its rotation around the sun. If the Earth were not tilted on its axis of rotation, the declination would always be 0°. However, the Earth is tilted by 23.45° and the declination angle varies plus or minus this amount. Only at the spring and fall equinoxes is the declination angle equal to 0°.

The declination angle can be calculated with the following equation:

dec= 23.45 x sin(2PI/365 x (d-81))

where d is the day of the year with Jan 1 as d = 1.

For more accurate calculations SPA algorithm is used.