What this calculator does
This tool computes the Sun's elevation (altitude above the horizon) and azimuth (compass direction, measured clockwise from North) for an observer anywhere on Earth. Instead of a single moment, it samples one row per week through an entire calendar year, all at the same local clock time, so you can watch how the Sun's height and direction drift with the seasons. It is universal physics — only the defaults are region-flavored (Tokyo coordinates and a +9 time-zone offset).
How to use it
Enter your longitude (East positive, West negative) and latitude (North positive, South negative). Set the time-zone offset of your civil clock from UTC (e.g. +9 for Japan, −5 for US Eastern Standard Time). Pick a year between 1900 and 2099, then the observation hour and minute of local standard time. The headline shows the first weekly sample; the cards show the highest and lowest weekly elevations; the table lists every weekly date with its elevation and azimuth.
The formula explained
From the calendar date and local clock time the algorithm builds the Julian Day, then derives the Sun's ecliptic longitude, declination (delta) and right ascension using low-precision NOAA/Meeus series. Greenwich sidereal time plus your longitude gives local sidereal time, and subtracting right ascension yields the hour angle \(H\). Finally
$$\text{elevation} = \arcsin\!\big(\sin\phi\cdot\sin\delta + \cos\phi\cdot\cos\delta\cdot\cos H\big)$$and
$$\text{azimuth} = \operatorname{atan2}\!\big(-\sin H,\; \tan\delta\cdot\cos\phi - \sin\phi\cdot\cos H\big).$$Accuracy is within roughly an arcminute for 1900–2099, degrading slightly at high latitude.
Worked example
Tokyo (longitude \(139.7447^\circ\), latitude \(35.6544^\circ\)), offset +9, 11:45 local time. On the summer-solstice week the Sun reaches about \(77.6^\circ\) elevation — nearly overhead. Around the winter solstice the same 11:45 clock time gives a much lower Sun, illustrating the seasonal swing.
Key Terms and Variables
- Elevation (altitude)
- The angle of the Sun above the local horizon, from \(-90^\circ\) (nadir) through \(0^\circ\) (horizon) to \(+90^\circ\) (zenith). Computed here as \(\arcsin(\sin\phi\sin\delta + \cos\phi\cos\delta\cos H)\).
- Azimuth
- The Sun's compass bearing measured clockwise from true north: \(0^\circ\) N, \(90^\circ\) E, \(180^\circ\) S, \(270^\circ\) W.
- Latitude (\(\phi\))
- The observer's north–south angular position, \(+90^\circ\) at the North Pole to \(-90^\circ\) at the South Pole. A primary input to the elevation and azimuth formulas.
- Solar declination (\(\delta\))
- The latitude on Earth where the Sun is directly overhead at noon on a given day, ranging \(\pm 23.44^\circ\) over the year. Derived from the ecliptic longitude via \(\delta = \arcsin(\sin\varepsilon\sin\lambda)\).
- Hour angle (\(H\))
- The angular distance of the Sun east or west of the local meridian, increasing by \(15^\circ\) per hour; \(H = 0\) at solar noon. Here \(H = (\text{GMST} + \text{longitude}) - \alpha\).
- Right ascension (\(\alpha\))
- The Sun's east–west coordinate on the celestial sphere, the celestial analogue of longitude, measured along the equator from the vernal equinox.
- Julian Day (JD)
- A continuous count of days (and fractions) since noon UT on 1 January 4713 BC, used to give every instant a single decimal number. The term \(n = \mathrm{JD} - 2451545\) counts days from the J2000.0 epoch.
- Sidereal time (GMST)
- Greenwich Mean Sidereal Time — time measured by the apparent rotation of the stars rather than the Sun. It links the Sun's right ascension to the observer's local meridian.
- Ecliptic longitude (\(\lambda\))
- The Sun's position along the ecliptic (Earth's orbital plane), \(0^\circ\) at the vernal equinox increasing to \(360^\circ\). Computed from the mean longitude \(L\) and the equation of center using the mean anomaly \(g\).
- UTC offset (timeZoneOffset)
- The number of hours your local clock is ahead of (positive) or behind (negative) Coordinated Universal Time; used to convert your observation hour to universal time. Tokyo/JST is \(+9\).
- Solar vs civil time
- Civil (clock) time is fixed by time zones and daylight rules, whereas solar time is set by the Sun's actual position (solar noon = Sun on the meridian). The two differ by the equation of time, longitude offset within the zone, and any daylight-saving adjustment, so the Sun is rarely due south at exactly 12:00 on the clock.
FAQ
Why is elevation sometimes negative? The Sun is below the horizon at that clock time — night, or before sunrise / after sunset.
Which way is azimuth measured? Clockwise from North: 0 = North, 90 = East, 180 = South, 270 = West.
Do I need both longitude and the time-zone offset? Yes. The offset converts your civil clock to UTC; the longitude converts UTC sidereal time to local sidereal time. They are different things.