The Position of the Sun
Long before satellites or computers, astronomers could tell you exactly where the Sun would rise, how high it would climb and when it would set. They could do it because the Sun's position in the sky is not random — it follows rules set by the geometry of the Earth, its orbit and its tilt. Here is how those rules work, and how a modern sun position calculator turns them into numbers.
Warning: Do not look directly at the sun without appropriate eye protection
Four ideas that decide where the Sun appears
If you stand in one spot and watch the Sun for a year, everything you see — the changing sunrise point, the length of the day, the height of the noon Sun — can be traced back to just four things working together.
The Earth's orbit
The Earth travels around the Sun once every 365.24 days along a near-circular path. Because that orbit is very slightly elliptical, the Earth is closest to the Sun in early January and farthest in early July — but this small change in distance is not what drives the seasons. The orbit matters because it sets the calendar of dates against which every other solar quantity is measured.
Axial tilt
The Earth's rotational axis is not straight up and down relative to its orbit. It leans over by about 23.44°, and that single number is the reason we have seasons. As the Earth moves around the Sun, the axis keeps pointing the same way in space, so for half the year the northern hemisphere leans toward the Sun and for the other half it leans away. This tilt is also why the Sun's highest point in the sky changes from week to week.
Earth's rotation
While the Earth orbits the Sun, it also spins on its tilted axis once every 24 hours. That daily rotation is what makes the Sun appear to rise, climb across the sky and set. The instant the Sun reaches its highest point each day is called solar noon, and the angle of the Sun above the horizon at any moment depends almost entirely on how far the Earth has rotated since that moment.
The seasons
Seasons are the combined effect of orbit, tilt and rotation. Around the June solstice the northern hemisphere is tilted toward the Sun, so the Sun climbs high, days are long and more sunlight falls on each square metre of ground. Six months later the situation reverses. The equinoxes in March and September are the two moments when neither hemisphere leans toward the Sun, and day and night are close to equal everywhere on Earth.
From geometry to a number in the sky
To turn those ideas into a precise position, astronomers describe the Sun with two angles at every instant: its altitude — how many degrees it sits above the horizon — and its azimuth — the compass bearing (north through east) along which it lies. Both come from a small set of well-understood quantities.
Solar declination: the Sun's latitude
Because the Earth's axis is tilted, the Sun appears to move north and south over the year. The angle between the Sun and the celestial equator is called the solar declination. It is about +23.44° at the June solstice, 0° at the equinoxes, and −23.44° at the December solstice. Declination depends only on the date, so it is the same for everyone on Earth on a given day — it is the first ingredient every sun position calculation needs.
The hour angle: how far the Earth has turned
The second ingredient is time. At solar noon the Sun is due south (or due north in the southern hemisphere) and at its highest. As the Earth rotates, the Sun appears to drift westward by 15° every hour. The angle measured westward from solar noon is the hour angle. It is zero at noon, negative in the morning and positive in the afternoon, and it tells the calculation exactly where in its daily arc the Sun currently sits.
Your latitude ties it together
Declination and the hour angle describe the Sun against the sky as a whole. To convert that into an altitude above your horizon, the calculation uses your latitude. The three combine in a single spherical-trigonometry relation: the sine of the Sun's altitude equals the sine of your latitude times the sine of the declination, plus the cosine of your latitude times the cosine of the declination times the cosine of the hour angle. From that one equation the Sun's height above the horizon follows at any moment.
Azimuth: which way to look
A second, similar relation gives the azimuth — the compass direction of the Sun. It uses the same three quantities but rearranged, and it tells you whether to face east in the morning, south at noon (from the northern hemisphere) or west in the evening. Together, altitude and azimuth pin the Sun to a single point in the sky for any observer.
How sunrise, sunset and solar noon are found
Sunrise and sunset are simply the moments when the Sun's altitude passes through the horizon. The calculation asks: at what hour angle would the Sun's altitude equal the horizon value? Solving the altitude equation for the hour angle gives two answers — one before noon (sunrise) and one after (sunset). Solar noon sits exactly halfway between them, and the Sun's maximum altitude for the day is reached at that moment.
Two small corrections make the result match what you actually see. The Sun's upper edge, not its centre, is what crosses the horizon, and the atmosphere bends sunlight upward by roughly half a degree near the horizon. Together these shift the effective horizon to about −0.833°, which is why sunrise and sunset are calculated against that value rather than a true 0°.
Why your longitude and time zone matter
Everything above is written in solar time — a clock that puts noon exactly when the Sun is highest. Civil time zones are different: they lump whole regions onto a single clock, so your local noon can be tens of minutes away from solar noon. Your longitude tells the calculation how far east or west of the time-zone centre you are, and that offset is what converts solar time into the sunrise and sunset times shown on a normal clock. This is why two cities in the same time zone can have noticeably different sunrise times.
The limits of the calculation
Near the poles the simple sunrise equation can break down. When the Sun never sets (polar day) or never rises (polar night), the horizon value is never reached and the equation has no solution — a sun position calculator detects this and reports that there is no sunrise or sunset that day. Away from the polar regions the formulae are accurate to within a minute or two for ordinary purposes, which is more than enough for planning, photography, architecture and daylight analysis.
Find out more
Learn how the Sun's position is described using two key angles in Understanding Solar Altitude and Azimuth.
See it working live
The ideas on this page are exactly what powers the Sun Summary page, which shows the Sun's current altitude, azimuth, sunrise, sunset and daylight duration for any city. To see how those numbers change across the year, try the Day length, Sun locations and Sun angles pages.