How to calculate the sun’s position: a worked example

Every number on this site comes from a short chain of formulas from Jean Meeus’s Astronomical Algorithms. Here is the whole chain, step by step, for London at 13:00 UTC on 15 October 2026, with every intermediate value, so you can follow it with a calculator or check your own code against it.

The question

Where is the sun over London at 14:00 on 15 October 2026?

London: latitude 51.5074° north, longitude 0.1278° west. The time: 13:00 UTC, 14:00 British Summer Time. The answer at the end of the chain: azimuth 200.69°, elevation 27.79°, or 27.82° as seen through the atmosphere.

Angles are in degrees; convert them to radians before taking a sine or a cosine. Longitudes east of Greenwich are positive here, so London’s is −0.1278°. Meeus counts them the other way round, which is the most common source of sign errors.

Step 1

Time as a Julian Day

Step 1: time
QuantityFormulaValue
Julian Day (UT)days since noon on 1 January 4713 BC; from Unix time: ms / 86,400,000 + 2,440,587.52461329.04167
Delta Tuniform time minus Earth-rotation time; about 69 s in 2015–203569 s
Julian Ephemeris DayJD + ΔT / 86,4002461329.04247
TJulian centuries from J2000: (JDE − 2,451,545) / 36,5250.267872484

The sun’s motion is computed in uniform time (JDE); the Earth’s rotation, in step 5, uses ordinary UT.

Step 2

Where the sun is on the ecliptic

Step 2: the sun’s true longitude (Meeus, chapter 25)
QuantityFormulaValue
Mean longitude L₀280.46646 + 36,000.76983 T + 0.0003032 T²204.08211°
Mean anomaly M357.52911 + 35,999.05029 T − 0.0001537 T²280.68411°
Eccentricity e0.016708634 − 0.000042037 T − 0.0000001267 T²0.0166974
Equation of the centre C(1.914602 − 0.004817 T − 0.000014 T²) sin M + (0.019993 − 0.000101 T) sin 2M + 0.000289 sin 3M−1.88717°
True longitudeL₀ + C202.19494°
Distance R1.000001018 (1 − e²) / (1 + e cos(M + C))0.997176 AU

Reduce every angle to 0–360° before you go on; T is small, but 36,000 T is not.

Step 3

Nutation, obliquity and aberration

Step 3: from true to apparent longitude (Meeus, chapters 22 and 25)
QuantityFormulaValue
Longitude of the moon’s node Ω125.04452 − 1,934.136261 T326.94264°
Nutation in longitude Δψ−17.20″ sin Ω − 1.32″ sin 2L☉ − 0.23″ sin 2L☾ + 0.21″ sin 2Ω+8.10″
Nutation in obliquity Δε9.20″ cos Ω + 0.57″ cos 2L☉ + 0.10″ cos 2L☾ − 0.09″ cos 2Ω+7.97″
Mean obliquity ε₀23°26′21.448″ − 46.8150″ T − 0.00059″ T² + 0.001813″ T³23.435808°
True obliquity εε₀ + Δε23.438020°
Aberration−20.4898″ / R−20.55″
Apparent longitude λtrue longitude + Δψ + aberration202.19148°

L☉ and L☾ are the mean longitudes of the sun and the moon, 280.4665 + 36,000.7698 T and 218.3165 + 481,267.8813 T. Nutation is the nodding of the Earth’s axis; aberration is the shift caused by the Earth’s own motion. Each is worth only seconds of arc, but together with the small terms of the orbit they decide whether a calculation is good to a thousandth of a degree or a hundredth.

Step 4

Right ascension and declination

Step 4: to the celestial equator (Meeus, chapter 13)
QuantityFormulaValue
Right ascension αatan2(cos ε sin λ, cos λ)200.51896°
Declination δasin(sin ε sin λ)−8.64049°

Use the two-argument arctangent, atan2, so the right ascension lands in the right quadrant. A declination of −8.6° means the sun is overhead at 8.6° south that day, so in London it stays fairly low.

Step 5

Sidereal time and the hour angle

Step 5: the Earth’s rotation (Meeus, chapter 12)
QuantityFormulaValue
Days from J2000 (UT) dJD − 2,451,5459784.04167
Mean sidereal time at Greenwich280.46061837 + 360.98564736629 d + 0.000387933 T² − T³ / 38,710,000219.07555°
Apparent sidereal timemean + Δψ cos ε219.07761°
Local hour angle Hsidereal time + longitude − α, reduced to −180° … +180°18.43085°

The hour angle says how far the sun has moved west of the meridian: 18.43° is about 1 hour 14 minutes after solar noon, which in London that day came at 12:46 BST.

Step 6

Elevation and azimuth

Step 6: to the horizon (Meeus, chapters 13, 16 and 40)
QuantityFormulaValue
Elevation from the Earth’s centreasin(sin φ sin δ + cos φ cos δ cos H)27.78786°
Azimuth from northatan2(sin H, cos H sin φ − tan δ cos φ) + 180°200.69028°
Parallax for the ground8.794″ / R × cos(elevation)7.80″
Elevation from the groundelevation − parallax27.78570°
Refraction (Saemundsson)1.02′ / tan(h + 10.3 / (h + 5.11))0.03184°
Apparent elevationelevation + refraction27.81754°

The azimuth formula measures from the south; adding 180° turns it into the usual compass bearing from north. The parallax correction is tiny for the sun, but it is the same correction that moves the moon by up to a degree.

Checking your work

Common mistakes, and how good the result is

  • Degrees and radians mixed up inside a sine or cosine: the most common bug of all.
  • The sign of the longitude: east positive here, west positive in Meeus.
  • atan instead of atan2, which puts the right ascension or the azimuth in the wrong quadrant half the time.
  • Unreduced angles: reduce to 0–360° after every step that can run large.
  • UT and uniform time: the sun’s position uses uniform time, sidereal time uses UT.

The same chain gives the equation of time, the difference between sundial and clock: L₀ − 0.0057183° − α + Δψ cos ε, here 3.56°, or 14.24 minutes. Against the reference values in Meeus’s worked examples and in NREL’s Solar Position Algorithm, this method lands within a few thousandths of a degree. The sun position map runs exactly these steps for any place and moment, and the article on elevation and azimuth explains what the two final numbers mean.

Keep reading

Related articles

All articles about the sun