Sun Azimuth / Elevation calculator

This page performs an approximate calculation of the observed sun position using only latitude/longitude, sidereal day/year, orbit eccentricity and axis angle. The calculation is “minimal”: 5 rotations to orient an observer in space and then one application of Kepler’s equation to calculate the position of the earth.

It does not incorporate minor factors such as atmospheric refraction, axial precession, Earth’s radius, the moon, other planets or other effects. Despite the limitations of the model, the calculations appear to be within half a degree of other more-complete models. A more accurate model may be found at NOAA, including an interactive JavaScript application (with readable source code in main.js) as well as downloadable spreadsheets.

You can download the JavaScript sources. Feel free to use it however you wish - it is under a Creative Commons Zero / Public Domain license.

Time

Coordinated universal time (UTC):

Location

Latitude: Longitude:

Calculated Sun Position

Azimuth:

Elevation: