Sun position

The direction and height of the sun at any place and moment, the length and direction of the shadows, and the arc it draws across the sky that day.

How to use it

  1. Choose a place, a date and a time in the local time of that place.
  2. Read the azimuth, the altitude and the shadow length. The sky chart shows the day's path; the map shows the direction of the sun.
  3. Press Now for the present moment.

5 practical uses

  1. Place solar panels or a sundial.
  2. Check which windows and rooms get sun at a given hour.
  3. Plan shade for a garden, a terrace or a playground.
  4. Set a photo so the sun is behind or beside the subject.
  5. Work out where a shadow falls at a given time.

The maths behind it

From the Julian day the sun's ecliptic longitude gives its declination δ and right ascension α; the local sidereal time θ gives the hour angle H = θ − α. Then sin h = sin φ sin δ + cos φ cos δ cos H for the altitude and tan A = sin H / (cos H sin φ − tan δ cos φ) for the azimuth. A shadow of a pole of height 1 has length 1/tan h and points away from the sun.

The numbers

Azimuth is the compass direction of the sun, clockwise from north. Altitude is its height above the horizon in degrees; 90° is straight overhead, which only happens in the tropics. The shadow length is the shadow of a vertical pole one unit tall, one over the tangent of the altitude, and it points away from the sun. Useful for placing solar panels, planning a photo, or seeing which windows get the afternoon sun.

Times are computed in the browser with the SunCalc library, which follows the astronomical almanac formulas to within a minute or so, and are shown in the local time of the place, including summer time, from its time zone. Sunrise and sunset are the moments the top edge of the sun meets a flat horizon, with the usual allowance for the bending of light in the air; a hill to the east delays your sunrise.

Questions and answers

What are azimuth and altitude?

Azimuth is the compass direction of the sun, clockwise from north. Altitude is its height above the horizon in degrees, 90 straight overhead.

How long is a shadow?

One over the tangent of the altitude, times the height of the object. At 45 degrees the shadow equals the height; at 30 degrees it is 1.7 times the height.

When is the sun straight overhead?

Only between the tropics, twice a year. Elsewhere the noon sun is always to the south (north in the southern hemisphere).

Embed this tool on your website

Paste this code where the tool should appear. It shows the tool alone, without this page's text, and links back here. It is free to use; the map data credit stays on the map.

<iframe src="https://waymorphic.com/tools/sun-position?embed=1" width="100%" height="760" style="border:0;border-radius:12px;max-width:100%" loading="lazy" allow="geolocation; fullscreen; clipboard-write" title="Sun position – Waymorphic Map"></iframe>

Change height to suit your page. To open the tool with a place already set, add the settings from this page's address bar (the part after #) to the end of the src. The embedded tool asks the visitor's browser for their location only when they press the button, and the allow attribute lets that work inside the frame.