How to calculate the Coordinates of the Sun

We here give the necessary formulae to calculate the Sun's horizontal coordinates (azimuth and altitude) for a given instant and location. As this represents a rather lengthy calculation it should be performed by a good programmable calculator or a computer. From this algorithm it is possible to find the coordinates to the nearest 0.01 degree for a time interval of 200 years centered on year 2000. This should be sufficient for most purposes. It is, however, important that all quantities are calculated to a sufficient number of digits and given in correct units, i.e. angles may be expressed in degrees, hours, radians etc.

1. Number of days and centuries from epoch J2000.0

Let Y be the year, M the month number (1 = January, 2 = February etc.), and D the day of the month. We first have to find the number of days do from the reference time 2000 January 1, 12h Universal Time (epoch J2000.0). This quantity can be obtained from the formula from
do = 367Y - INT{(7/4)[Y+INT((M+9)/12)]} + INT(275M/9) + D -730531.5  [1]
Here does INT indicate the integer part of the value within the paranthesis, e.g. INT(3.77) = 3. This formula is valid for the time interval 1900 March 1 to 2100 February 28.

Then we obtain the number of Julian centuries To from J2000.0 from

To = do / 36525                                                      [2]

2. Sidereal Time

The sidereal time So (in hours) for the meridian of Greenwich, at midnight (00h) UT for a given date, can be calculated as follows
      h           h
So = 6.6974 + 2400.0513 To                                           [3]
The sidereal time SG of the Greenwich meridian for the universal time tUT is
SG = So + (366.2422 / 365.2422) tUT                                   [4]
where 365.2422 is the length of the tropical year in days. We finally obtain the local sidereal time S for the geographical longitude L
S = SG + L                                                           [5]

3. Solar Coordinates

We first find the number of days d from J2000.0 for the given date and time
d = do + tUT / 24                                                     [6]
where do can be found from relation [1]. The number of centuries T from the reference time is
T = d / 36525                                                        [7]
We can now find the Sun's mean longitude Lo and its mean anomaly Mo from
        o           o
Lo = 280.466 + 36000.770 T                                           [8]

        o           o
Mo = 357.529 + 35999.050 T                                           [9]
The Sun's equation of center C, which accounts for the eccentrisity of Earth's orbit around the Sun, is given by
      o       o                 o
C = (1.915 - 0.005 T) sin Mo + 0.020 sin 2Mo                         [10]
We can now find the true ecliptical longitude of the Sun LS by adding C to Lo, i.e.
LS =  Lo +  C                                                        [11]
In order to find the Sun's equatorial coordinates, right ascension RS and declination DS, we need to know the value of K, the obliquity of the ecliptic
      o       o
K = 23.439 - 0.013 T                                                [12]
The Sun's right ascension can now be found from
tan RS = tan LS cos K                                                [13]
where it has to be remembered that RS is in the same quadrant as LS.

Finally, the declination is given by

sin DS = sin RS sin K                                                [14]

4. Horizontal Coordinates

We now proceed to find the horizontal coordinates for the Sun (or other astronomical objects) for a place at geographical longitude L and latitude B.

First we have to know the hour angle of the object H. It is given from the definition of the sidereal time: S = H + RS, i.e.

H = S - RS                                                           [15]
The true altitude (angular elevation) h of the Sun is found from
sin h = sin B sin DS + cos B cos DS cos H                            [16]
The azimuth A, measured eastward from the North, is given by
                 - sin H
tan A = ---------------------------                                 [17]
        tan DS cos B  - sin B cos H
The correct quadrant is found by checking the signs of the nominator and denominator.

How to calculate Air Mass

If we are interested to study how light from a source outside Earth's atmosphere (e.g. the Sun) is affected by the atmosphere we often need to know the air mass X, which is the amount of air between us and the object. When viewing towards zenith (altitude 90 degrees) we are looking through one air mass. The air mass increases with decreasing altitude. A good representation is Rozenberg's empirical relation
X = 1 / [sin ho + 0.025 exp(-11 sin ho)]                             [18]
where ho is the apparent altitude of the object. This formula can be used all down to the horizon (where it gives X = 40).

References:
Meeus, J., 1991, "Astronomical Algorithms", Willmann-Bell, Richmond, VA. [Most of the formulae given here are based on this work.]
Rozenberg, G. V. 1966, "Twilight: A Study in Atmospheric Optics", Plenum Press, New York.


Last updated on July 14, 1999 by BHG / Bjørn Håkon Granslo