Sun position and sun path calculator

Where is the sun – now, this evening, on the shortest day of the year? SunPosition computes the sun's azimuth and altitude for any place and time and shows the sun path as a chart, on the map and right in the camera view. Free in the browser, nothing to install.

Guides

  • How to calculate shadow length – How long is the shadow of a house, tree or hedge? The formula, a table by sun altitude, examples for summer and winter – and the calculator for your location.
  • Understanding and calculating the sun path – Where does the sun rise, how high is it at noon, how long is the day? The sun path through the year, with values for London, Edinburgh, New York and more.
  • See the sun path in your camera view – Check on site with your phone which tree or building hides the sun: how to align SunPosition's camera view by the sun and read the sun paths in the image.
  • Compass and magnetic declination – Why a compass misses by degrees and how to calibrate it on the sun – a SatFinder guide.
  • A compass set by the sun – SunCompass: sight the sun once, then the compass shows true north – without a magnetometer.
  • Calculate solar yield – SolarFinder: annual yield, self-sufficiency and payback of a photovoltaic system for your roof.

What SunPosition calculates

  • Sun position: azimuth and altitude for any place, date and time – relative to true or magnetic north, with the local magnetic declination.
  • The day's sun path together with the paths of June 21 and December 21, as a chart, on the map and in the camera view.
  • Sunrise, sunset, solar noon and day length, plus the day length over the whole year.
  • Shadow length and direction for your own object height, drawn to scale on the map.
  • Twilight: civil, nautical and astronomical, plus golden hour and blue hour in the morning and evening.
  • Moon: altitude, direction, moonrise and moonset, phase and illuminated fraction.
  • The next solar eclipse visible in daylight at the location – up to twelve years ahead, with time, type and coverage.
  • Hourly table of azimuth, altitude and shadow, a monthly table with CSV download and the search “When is the sun in a given direction?”.

FAQ

What are azimuth and altitude?

The azimuth is the compass direction of the sun in degrees, counted clockwise from north: 90° is east, 180° south, 270° west. The altitude is the angle above the horizon – 0° at sunrise and sunset, and at 50° latitude about 17° at noon on December 21 and up to 63° on June 21.

What is the sun path good for?

For patios, balconies and gardens: when does the sun come round the house, when does it disappear behind the neighbour's building? When buying a home, the winter path shows whether any sun reaches the living room in December. Photovoltaics asks the same question: anything on the horizon that rises above the sun path casts a shadow on the modules.

How do I calculate shadow length?

Shadow length = object height divided by the tangent of the sun's altitude. At 45° the shadow is as long as the object is tall, at 20° 2.7 times as long, at 10° 5.7 times. Under “Plan” you enter the height of your house, tree or hedge and get the length and direction of its shadow; the map draws it to scale.

When are golden hour and blue hour?

SunPosition counts as golden hour the time the sun is between 6° above and 4° below the horizon, and as blue hour 4° to 6° below. The “Twilight” button on the map shows both for morning and evening, together with civil, nautical and astronomical twilight (sun 6°, 12° and 18° below the horizon).

Does SunPosition show the moon too?

Yes. The “Moon” switch in the top band shows the moon's altitude, direction, moonrise and moonset, phase and illuminated fraction, plus the moon path in the chart and on the map. Buttons jump to the next new moon, full moon and quarters.

Can I see the sun path in the camera view?

Yes, on phones and tablets: the camera view overlays the sun path of the selected day and of both solstices on the image, so you can see on site which tree hides the winter sun. For accurate directions, align the view once by the sun itself – next to metal a phone's magnetic compass is often off by 10–30°.

How SunPosition calculates

The sun's position follows the equations in Jean Meeus, “Astronomical Algorithms”, in the form the US agency NOAA uses for its solar calculator. The direction is accurate to better than 0.1°. The altitude shown is the geometric one without refraction – just above the horizon the sun appears up to a little over half a degree higher.

Sunrise and sunset are taken as the moment the centre of the sun is 0.833° below the horizon: 0.567° of atmospheric refraction plus 0.266° for the sun's radius. That is the convention of NOAA and the almanacs; up to 72° latitude the times are good to about a minute. Mountains, buildings and the weather shift the moment you actually see the sun.

The moon is computed to about 0.05°, eclipse coverage to a few percent. The magnetic declination for the “magnetic” switch comes from the World Magnetic Model.