Lably
Skip to content

Position of the Sun

Calculating the Sun's location in the sky at a given time and place

  • 12 min read
  • 5 chapters

Related on Lably

Through Sky, Time and Geographic coordinate system

Earth's rotation about its axis causes diurnal motion, so that the Sun appears to move across the sky in a Sun path that depends on the observer's latitude. The time when the Sun transits the observer's meridian depends on the longitude.

To find the Sun's position for a given geographic location at a given local time, one may proceed in three steps:

  1. calculate the Sun's position in the ecliptic coordinate system,
  2. convert to the equatorial coordinate system, and
  3. convert to the horizontal coordinate system.

The resulting Sun angles are the solar zenith angle and solar azimuth angle, which can be used to depict the Sun path.

This calculation is useful in astronomy, navigation, surveying, meteorology, climatology, solar energy, and sundial design.

Approximate position

Ecliptic coordinates

These equations, from the Astronomical Almanac, can be used to calculate the apparent coordinates of the Sun, mean equinox and ecliptic of date, to a precision of about 0°.01 (36″), for dates between 1950 and 2050. Similar equations are coded into a Fortran 90 routine in Ref. and are used to calculate the solar zenith angle and solar azimuth angle as observed from the surface of the Earth.

Start by calculating n, the number of days (positive or negative, including fractional days) since Greenwich noon, Terrestrial Time, on 1 January 2000 (J2000.0). If the Julian date for the desired time is known, then

n=JD−2451545.0

The mean longitude of the Sun, corrected for the aberration of light, is:

L=280.460∘+0.9856474∘n

The mean anomaly of the Sun (actually, of the Earth in its orbit around the Sun, but it is convenient to pretend the Sun orbits the Earth), is:

g=357.528∘+0.9856003∘n

Put L and g in the range 0° to 360° by adding or subtracting multiples of 360° as needed‍— which is to say, L and g are really to be evaluated (mod 360).

Finally, the ecliptic longitude of the Sun is:

λ=L+1.915∘sin⁡g+0.020∘sin⁡2g

The ecliptic latitude of the Sun is nearly:

β=0,

as the ecliptic latitude of the Sun never exceeds 0.00033° (a little over 1″), and the distance of the Sun from the Earth, in astronomical units, is:

R=1.00014−0.01671cos⁡g−0.00014cos⁡2g.

Obliquity of the ecliptic

Where the obliquity of the ecliptic is not obtained elsewhere, it can be approximated:

ϵ=23.439∘−0.0000004∘n

Equatorial coordinates

λ, β and R form a complete position of the Sun in the ecliptic coordinate system. This can be converted to the equatorial coordinate system by calculating the obliquity of the ecliptic, ϵ, and continuing:

Right ascension,

α=arctan⁡(cos⁡ϵtan⁡λ), where α is in the same quadrant as λ,

To get RA at the right quadrant on computer programs use double argument Arctan function such as ATAN2(y,x)

α=arctan⁡2(cos⁡ϵsin⁡λ,cos⁡λ)

and declination,

δ=arcsin⁡(sin⁡ϵsin⁡λ).

Rectangular equatorial coordinates

Right-handed rectangular equatorial coordinates in astronomical units are:

X=Rcos⁡λ
Y=Rcos⁡ϵsin⁡λ
Z=Rsin⁡ϵsin⁡λ
Where X axis is in the direction of the March equinox, the Y axis towards June Solstice, and the Z axis towards the North celestial pole.

Horizontal coordinates

Sign in to keep reading

4 more chapters are free with a Lably account.

More in Astronomy