# Sun Position & Shadow Length Simulator

Compute the sun’s elevation and azimuth (NOAA algorithm) for any latitude, longitude, date and time, plus the length and direction of the shadow cast by an object of a given height, with sunrise/sunset and a full-day shadow curve

> Canonical page: https://elysiatools.com/en/tools/sun-position-shadow-simulator

- **Category:** Astronomy

- **Keywords:** sun position, solar elevation, azimuth, shadow length, sunrise, sunset, solar noon, noaa, solar calculator, daylight, astronomy, photography, architecture

## Overview

Enter latitude, longitude, a date/time and the height of an object (a pole, a building, a tree), and the tool computes:

- **Sun elevation** (altitude above the horizon) and **azimuth** (compass bearing, 0=N, 90=E) using the NOAA/Spencer solar position algorithm.
- **Shadow length** on the ground = object height ÷ tan(elevation), shown both in absolute units and as a multiple of the object height.
- **Shadow direction** (the antipode of the sun azimuth — where the shadow tip falls from the object's base).
- **Sunrise / solar noon / sunset** in local standard time, including polar-night / midnight-sun detection.
- A **full-day curve** of elevation and shadow length, with the selected moment marked, and a **top-down shadow plan** showing the object, sun ray, and cast shadow.

Algorithm details:
- Solar declination via Spencer's series; equation of time via the NOAA 3-term approximation.
- Apparent elevation includes NOAA's piecewise atmospheric-refraction correction (accurate near the horizon).
- You can choose **UTC** (input time treated as UTC), or **local solar time** (time-of-day at the longitude, ignoring time-zone and DST — handy for a "where is the sun at 10am solar time" answer).

Accuracy is ~±0.5° in elevation/azimuth for years 1950–2050 — ideal for solar panel siting, architectural shadow studies, gardening, photography planning, or film/game level design.

## Inputs

- **Latitude (°)** (number): e.g. 40.7128 (positive = North)
- **Longitude (°)** (number): e.g. -74.0060 (negative = West)
- **Date** (date)
- **Hour of day (0–24, fractional allowed)** (number): e.g. 12 for noon
- **Object height (m)** (number): e.g. 1.8 for a person
- **Time zone offset (hours from UTC)** (number): e.g. -5 for EST; 0 for UTC; 8 for China
- **Time zone** (select)

## When to use

- Planning solar panel installations to determine optimal tilt angles and avoid shading from nearby structures.
- Designing architectural layouts or landscaping projects that require detailed seasonal shadow analysis.
- Scheduling outdoor photography or film shoots to capture specific lighting angles and shadow lengths.

## How it works

- Input the geographic coordinates (latitude and longitude), date, time, and the height of the object casting the shadow.
- Select the time basis, choosing either UTC with a timezone offset or local solar time to ignore daylight saving adjustments.
- The simulator applies the NOAA/Spencer solar position algorithm, incorporating atmospheric refraction corrections, to calculate the sun's elevation and azimuth.
- It outputs the shadow length and direction, alongside sunrise, solar noon, sunset times, and a visual full-day shadow curve.

## Use cases

- Determining the height limits of new fences or buildings to prevent blocking sunlight to neighboring gardens.
- Calculating the exact time of day when a specific landmark will cast a shadow over a target area.
- Optimizing agricultural crop placement based on daily and seasonal shade patterns from surrounding trees.

## Frequently asked questions

### How accurate is the solar position calculation?

The simulator uses the NOAA/Spencer algorithm, which provides an accuracy of approximately ±0.5° for the years 1950 to 2050.

### What is the difference between UTC and local solar time?

UTC uses standard clock time adjusted by your timezone offset, while local solar time calculates the sun's position based strictly on your longitude, ignoring time zones and daylight saving time.

### How is the shadow direction determined?

The shadow direction is calculated as the antipode (opposite angle) of the sun's azimuth, indicating where the shadow tip falls relative to the object's base.

### Does the simulator account for atmospheric refraction?

Yes, it includes NOAA's piecewise atmospheric-refraction correction, which ensures high accuracy even when the sun is near the horizon.

### Can this tool detect polar nights or midnight sun?

Yes, the algorithm automatically detects and displays polar night and midnight sun conditions based on the input latitude and date.

## Related tools

- [Binary Star Eclipse Light Curve and Rossiter-McLaughlin Radial Velocity Fitter](https://elysiatools.com/en/tools/binary-star-eclipse-light-curve-and-rossiter-mclaughlin-radial-velocity-fitter): Fit spectroscopic-binary radial velocities with a Levenberg-Marquardt orbit solver, derive the mass ratio and mass function, analyse eclipse-time O−C residuals, estimate the Rossiter-McLaughlin spin-orbit angle, and preview a geometric eclipse light curve.
- [Telescope Field of View Calculator](https://elysiatools.com/en/tools/telescope-field-of-view-calculator): Compute telescope optics for visual astronomy: magnification, true field of view, focal ratio, exit pupil, limiting magnitude, Dawes/Rayleigh resolution and useful-magnification range. Enter aperture, telescope focal length, an eyepiece focal length and its AFOV (metric mm or imperial inches), pick a target (deep-sky, planetary, lunar or terrestrial), and get a scaled field-of-view overlay plus target-specific advice on exit pupil and framing.
- [Blue Hour Calculator](https://elysiatools.com/en/tools/blue-hour): Calculate blue hour times - the magical time before sunrise and after sunset with deep blue skies
- [Constellation Finder](https://elysiatools.com/en/tools/constellation-finder): Find visible constellations and zodiac signs for any date
- [Daylight Calculator](https://elysiatools.com/en/tools/daylight-calculator): Calculate daylight hours, sunrise, and sunset times for any location and date
- [Golden Hour Calculator](https://elysiatools.com/en/tools/golden-hour): Calculate golden hour times - the best time for photography with soft, warm light
- [ISS & Satellite Pass Tracker](https://elysiatools.com/en/tools/iss-satellite-pass-tracker): Predict ISS, Hubble, and representative Starlink passes for a chosen observing point and date
- [Planet Position Finder](https://elysiatools.com/en/tools/planet-position): Find the current position of planets in the sky

## Samples

- [Length Distance Samples](https://elysiatools.com/en/samples/length-distance): Educational length and distance reference samples covering metric and imperial units, everyday comparisons, and conversion literacy
- [Length Unit Samples](https://elysiatools.com/en/samples/length-unit): Practical length unit references you can copy when you want to compare common units directly with meters (m)
- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion
