3D Spatial · 3D

3D Sun Position & Shadow Simulator

See where the sun sits and how long a shadow it casts.

Where the sun sits in the sky — and how long a shadow it throws — changes by the minute, the season, and your spot on the planet. The Sun Position & Shadow Length Simulator turns those changes into numbers you can act on. Pick a city or type your own latitude and longitude, choose a date, drag the time slider, and set the height of an object, and the tool computes the sun's elevation (how high above the horizon it is), its azimuth (its compass bearing), and the resulting shadow length and direction for a vertical pole, wall, tree, or building of that height.

As you change the inputs, an interactive 3D scene stands a bar of your chosen height on a ground plane, moves a directional "sun" light to the computed elevation and azimuth, and casts the real shadow so you can see it stretch and swing through the day. A red marker points north for orientation. This is genuinely useful for planning a garden, positioning solar panels, judging how much light a window will get, or shooting photos with the light you want.

An honest note on accuracy: this simulator uses a well-established textbook approximation of solar geometry, not a survey-grade ephemeris. It is accurate to within roughly a degree of sun elevation for most of the day, which is plenty for planning. Near sunrise and sunset the shadow-length error grows quickly (the math divides by the tangent of a very small angle), and the model does not include atmospheric refraction, altitude, or local terrain. Use it to plan and reason, not to survey a boundary.

Shadow length

Sun elevation°
Sun azimuth° ()
Shadow direction
Solar declination°

Approximate model — see the accuracy note below.

Embed this tool on your site

Paste this snippet where you want the tool to appear. It links back to us and stays ad-free.

Preview embed

Formula

shadow = height / tan(solar elevation)

How to use the 3d sun position & shadow simulator

  1. Choose a city preset, or set latitude (positive north of the equator) and longitude (positive east) directly, plus the location's UTC offset in hours. The offset matters because your clock is tied to a time zone, not to the true position of the sun.
  2. Pick the date. The sun's path is dramatically different in June versus December away from the equator, so the season is as important as the hour.
  3. Drag the time slider to the local clock time you care about. Watch the elevation rise toward solar noon and fall toward evening, and the shadow shrink and then lengthen.
  4. Enter the height of the object casting the shadow — a fence post, a tree, a building — in metres. If your measurement is in feet, convert first with the unit converter; the shadow length comes back in the same unit you enter.
  5. Read the results: sun elevation and azimuth (with a compass letter), the shadow length, and the compass direction the shadow points. Orbit the 3D view to confirm the geometry, then use the copy or share button to send the exact scenario to someone else.
  6. Want to apply it? See our guides on how much sunlight a window will get and where shadows fall in a garden or yard for worked, real-world walkthroughs.

Worked example

Suppose you have a 10-metre flagpole in New York (latitude 40.71° N, longitude −74.01°, UTC−4 in summer) and you want to know how its shadow behaves on the June solstice, 21 June. Enter those values and walk the time slider across the day. The simulator returns:

  • 09:00 — sun elevation ≈ 37.9°, azimuth ≈ 90° (due east). Shadow ≈ 12.85 m, pointing west.
  • 12:00 — elevation ≈ 69.0°, azimuth ≈ 141° (south-east). Shadow ≈ 3.85 m, pointing north-west.
  • 13:00 (near solar noon) — elevation ≈ 72.7°, azimuth ≈ 182° (almost due south). Shadow at its shortest, ≈ 3.11 m, pointing north.
  • 18:00 — elevation ≈ 25.6°, azimuth ≈ 280° (west-north-west). Shadow ≈ 20.89 m, pointing east.

Two things stand out. First, the shadow is shortest around solar noon — here about 3.1 m for a 10 m pole, because the sun is highest (72.7°) and shadow = height ÷ tan(elevation) = 10 ÷ tan(72.7°) ≈ 3.11 m. Second, the shadow sweeps clockwise from west in the morning, through north at midday, to east in the evening — always pointing away from the sun. Every number above comes straight from this tool's own tested formula.

Common mistakes to avoid

  • Confusing clock time with solar time. Noon on your watch is rarely the moment the sun is highest — time zones are wide, and the "equation of time" shifts true solar noon by up to about 16 minutes across the year. The tool corrects for both using your longitude and UTC offset, so trust the elevation, not the clock.
  • Getting the sign of latitude or longitude wrong. This tool uses north-positive latitude and east-positive longitude. New York is −74° longitude (west), Tokyo is +139° (east). A flipped sign sends the sun to the wrong side of the sky.
  • Forgetting the season. At mid-latitudes the midday sun can sit 47° higher in June than in December (twice the 23.45° tilt of the Earth's axis), which more than triples a midday shadow. Always set the date, not just the time.
  • Trusting near-horizon numbers too literally. As elevation approaches zero the shadow length races toward infinity, and small model errors and unmodeled atmospheric refraction (which lifts the low sun by roughly half a degree) make the exact figure unreliable. Treat sunrise/sunset shadows as "very long" rather than a precise measurement.
  • Assuming survey-grade precision. This is a planning-grade approximation. For legal boundaries, precise solar-panel engineering, or eclipse timing, use a full ephemeris or a surveyor.

Frequently asked questions

Is the sun position exact?

It uses a standard textbook approximation (Cooper's declination plus the equation of time), accurate to about a degree of elevation — great for planning, but not a survey-grade ephemeris.

Which way does the shadow point?

Directly away from the sun — the sun's azimuth plus 180°. In the northern hemisphere midday shadows point north; in the southern hemisphere they point south.

What formula does this use, and how accurate is it?

Solar declination comes from Cooper's equation (δ = 23.45° · sin(360° · (284 + n) / 365), where n is the day of the year), the difference between clock and sun time from Spencer's equation-of-time series, and the elevation and azimuth from the standard spherical-astronomy formulas. Shadow length is height ÷ tan(elevation). This is the same approach taught in solar-energy engineering texts (for example Duffie & Beckman) and is typically within about a degree of sun elevation — good for planning, but not a substitute for a precise ephemeris, especially near sunrise and sunset.

Why is the shadow so long — or infinite — near sunrise and sunset?

Shadow length is the object's height divided by the tangent of the sun's elevation. As the sun nears the horizon that elevation approaches zero, its tangent approaches zero, and the shadow shoots toward infinity. In reality the low sun is dimmer and diffused and atmospheric refraction lifts it slightly, so treat those enormous figures as "the shadow stretches out very far," not an exact length. The tool caps absurdly long values and flags them.

Which direction does the shadow point?

Always directly away from the sun — the shadow's compass bearing is the sun's azimuth plus 180°. In the northern hemisphere the midday sun is to the south, so midday shadows point north; in the southern hemisphere it is the reverse. Through the day the shadow sweeps from roughly west at sunrise, through north (northern hemisphere) at solar noon, to east at sunset.

Feedback

Last updated: 2026-07-05