Sun Position and Shadow Length Calculator
Height and direction of the Sun at any clock time, place and day, the length of a shadow, and the Sun's path through the day drawn against the solstices.
Results
The dashed line marks the value you entered.
What this tool does
The Sun's height follows from three numbers: your latitude, the Sun's declination that day and how far it is from solar noon. Clock time is not solar time — the time zone, summer time, your longitude within the zone and the equation of time (up to about 16 minutes either way through the year) all shift it — so the calculator converts your clock time first. A shadow is the object's height divided by the tangent of the Sun's elevation: at 45° it equals the height, and below 10° it is more than five times longer. Day of year: 1 January is 1, 21 June is 172 and 21 December is 355 in a normal year.
Formula
sin α = sin φ sin δ + cos φ cos δ cos h · h = 15° × (solar time − 12) · shadow = height ÷ tan α
Variables
| Symbol | Meaning | Unit |
|---|---|---|
la | Latitude | ° |
lo | Longitude (east positive) | ° |
tz | Clock offset from UTC (with summer time) | h |
nd | Day of the year | — |
hr | Clock time (hours, 14.5 = 14:30) | h |
hh | Object height | m |
EL | Sun elevation above the horizon | ° |
AZ | Sun azimuth (from north, clockwise) | ° |
SH | Shadow length | m |
UP | Sun above the horizon? | — |
SN | Solar noon (clock time) | h |
NE | Sun elevation at solar noon | ° |
DC | Solar declination | ° |
EQ | Equation of time | min |
Worked example
- Latitude38.72 °
- Longitude (east positive)-9.14 °
- Clock offset from UTC (with summer time)1 h
- Day of the year105
- Clock time (hours, 14.5 = 14:30)15 h
- Object height1.8 m
- Sun elevation above the horizon55.33 °
- Sun azimuth (from north, clockwise)218.00 °
- Shadow length1.25 m
- Sun above the horizon?Yes
- Solar noon (clock time)13.613 h
- Sun elevation at solar noon60.76 °
- Solar declination9.481 °
- Equation of time-0.24 min
Limitations
- Declination and the equation of time come from Spencer's 1971 series, good to a small fraction of a degree. Atmospheric refraction, which lifts the Sun by about half a degree at the horizon, is not included.
- The default values are typical reference figures, not measurements of your situation. Replace them with your own data whenever you have it.