Sunlit

Sunlit › Guides

Shadow length calculator for iPhone

Shadow length is one line of trigonometry, and the ratio is the same for everything standing in the same place at the same instant. The interesting part is what happens near the horizon.

Download Sunlit on the App Store

Free to install. iPhone with iOS 17 or later. Today at your current location is free forever in all four views, and Sunlit Pro is one payment of 9.99 EUR that opens every other date and place.

The whole calculation is one line

A vertical object of height h standing on level ground, with the sun at an apparent altitude a above the horizon, casts a shadow of length

length = h / tan(a)

The shadow points along the sun's azimuth plus 180 degrees. The ratio of length to height is the cotangent of the altitude, which means it is the same for every object standing there at that instant. Measure one shadow and you know them all.

Sun altitudeShadow, as a multiple of heightA 2 m person
60 degrees0.581.2 m
45 degrees1.002.0 m
30 degrees1.733.5 m
15 degrees3.737.5 m
5 degrees11.422.9 m
1 degree57.3114.6 m

Two details that decide whether the answer is any good

Use the refracted altitude. The atmosphere bends the ray on its way in, so the sun appears higher than it geometrically is, by about half a degree near the horizon. The shadow follows the light as it arrives, not the direction the sun really lies in. At an altitude of half a degree that difference is the gap between a shadow of a hundred times the height and no shadow at all. Sunlit uses the apparent altitude, with a refraction model corrected for pressure and temperature.

Below the horizon there is no number. As the altitude goes to zero the tangent goes to zero and the length goes to infinity. It is not a very long shadow, it is an unbounded one, and an app that prints a figure for it is printing a lie. Sunlit returns no shadow length at or below the horizon and says so on the screen, which is what the "None" in the readout means.

What people use it for

  • Row spacing for solar panels. The controlling case is the low winter sun, not the summer one. Pick your worst acceptable date, read the minimum working altitude, and the ratio gives you the pitch between rows.
  • A fence, a hedge or an extension. Set the height and see how far into the neighbouring garden or the room the shadow reaches at the hours that matter.
  • Photography and film. A long shadow is a compositional element with a known length and a known direction, hours before you get there.
  • Reading a photograph. If you know the height of an object and the length of its shadow, the ratio gives you the solar altitude, and the direction of the shadow gives you the azimuth.

Where the flat ground assumption breaks

The formula is exact geometry on level ground and it says nothing about the world. It does not know whether the ground slopes, whether anything is standing where the shadow would fall, or whether the sun is already behind a ridge. That last one matters: a shadow computed for an instant when your measured skyline has the sun hidden is a shadow nobody will see. Sunlit keeps the two separate, and the measured horizon profile is what tells you which is which.

Reading it in the app

Shadow length for today, at the place you are standing, sits in the Sky view readout next to azimuth and altitude, and it is free forever. Drag the time scrubber and it moves with the day. On the Map view you can set the height of an object and see the shadow projected over the terrain in the right direction. Other dates, other places and the measured skyline are part of Sunlit Pro, one payment of 9.99 EUR.

Shadow length for today, free, in the Sky view.

Drag the time scrubber and watch the length and the direction move with the sun.

Download Sunlit on the App Store