The position of the Sun in the sky is a function of both the time and the geographic location of observation on Earth's surface.
To find the Sun's position for a given location at a given time, one may therefore proceed in three steps as follows:[1][2] This calculation is useful in astronomy, navigation, surveying, meteorology, climatology, solar energy, and sundial design.
, and continuing: Right ascension, To get RA at the right quadrant on computer programs use double argument Arctan function such as ATAN2(y,x) and declination, Right-handed rectangular equatorial coordinates in astronomical units are: The Sun appears to move northward during the northern spring, crossing the celestial equator on the March equinox.
Its declination reaches a maximum equal to the angle of Earth's axial tilt (23.44° or 23°26')[8][9] on the June solstice, then decreases until reaching its minimum (−23.44° or -23°26') on the December solstice, when its value is the negative of the axial tilt.
Eventually, the Sun would be directly above the South Pole, with a declination of −90°; then it would start to move northward at a constant speed.
However, even when the axial tilt equals that of the actual Earth, the maxima and minima remain more acute than those of a sine wave.
This makes processes like the variation of the solar declination happen faster in January than in July.
Also, since perihelion and aphelion do not happen on the exact dates as the solstices, the maxima and minima are slightly asymmetrical.
At the solstices, the angle between the rays of the Sun and the plane of the Earth's equator reaches its maximum value of 23.44°.
The Sun's declination at any given moment is calculated by: where EL is the ecliptic longitude (essentially, the Earth's position in its orbit).
The circle approximation means the EL would be 90° ahead of the solstices in Earth's orbit (at the equinoxes), so that sin(EL) can be written as sin(90+NDS)=cos(NDS) where NDS is the number of days after the December solstice.
By also using the approximation that arcsin[sin(d)·cos(NDS)] is close to d·cos(NDS), the following frequently used formula is obtained: where N is the day of the year beginning with N=0 at midnight Universal Time (UT) as January 1 begins (i.e. the days part of the ordinal date −1).
The sine function approximation by itself leads to an error of up to 0.26° and has been discouraged for use in solar energy applications.
[11] An additional error of up to 0.5° can occur in all equations around the equinoxes if not using a decimal place when selecting N to adjust for the time after UT midnight for the beginning of that day.
The eccentricity varies very slowly over time, but for dates fairly close to the present, it can be considered to be constant.
These accuracies are compared to NOAA's advanced calculations[13][14] which are based on the 1999 Jean Meeus algorithm that is accurate to within 0.01°.
Corrections may also include the effects of the moon in offsetting the Earth's position from the center of the pair's orbit around the Sun.
The Sun's declination can be used, along with its right ascension, to calculate its azimuth and also its true elevation, which can then be corrected for refraction to give its apparent position.
Since the Earth rotates at a mean speed of one degree every four minutes, relative to the Sun, this 16-minute displacement corresponds to a shift eastward or westward of about four degrees in the apparent position of the Sun, compared with its mean position.
The oscillation is measured in units of time, minutes and seconds, corresponding to the amount that a sundial would be ahead of a clock.
Some analemmas are marked to show the position of the Sun on the graph on various dates, a few days apart, throughout the year.
This enables the analemma to be used to make simple analog computations of quantities such as the times and azimuths of sunrise and sunset.