Sunrise/Sunset & Sun Position Calculator
Understanding Sun Calculations
This calculator estimates sunrise, sunset, twilight times, and the Sun's position (azimuth and altitude) for a given date, time, and location. These calculations are based on astronomical formulas that model the Earth's orbit and rotation.
Key Concepts:
- Solar Declination (δ): The angle between the rays of the Sun and the plane of the Earth's equator. It varies throughout the year from approximately -23.45° (winter solstice) to +23.45° (summer solstice).
- Equation of Time (EoT): The difference between apparent solar time (time by a sundial) and mean solar time (time by a clock). It arises because of the Earth's elliptical orbit and axial tilt. Max variation is about ±16 minutes.
- Hour Angle (H): The angular distance of the Sun east or west of the local meridian due to Earth's rotation. It is 0° at solar noon, negative in the morning, and positive in the afternoon.
- Azimuth (Az): The Sun's compass direction, measured clockwise from North (0° = North, 90° = East, 180° = South, 270° = West).
- Altitude/Elevation (h): The Sun's angle above (or below) the horizon. 0° is on the horizon, 90° is directly overhead (zenith).
- Sunrise/Sunset: Defined as when the upper limb of the Sun is on the horizon. For calculation, this is often approximated as when the center of the Sun is about -0.833° below the geometric horizon (accounting for atmospheric refraction and the Sun's semi-diameter).
- Twilights: Periods of partial illumination before sunrise and after sunset.
- Civil Twilight: Sun's center is 0° to -6° below the horizon. Brightest form of twilight.
- Nautical Twilight: Sun's center is -6° to -12° below the horizon. Horizon and brighter stars visible.
- Astronomical Twilight: Sun's center is -12° to -18° below the horizon. Sky is dark enough for most astronomical observations.
General Calculation Approach:
- Calculate Julian Day for the date.
- Determine solar coordinates like declination and the Equation of Time.
- Calculate the hour angle for sunrise/sunset events using the desired solar altitude (e.g., -0.833° for sunrise/set, -6° for civil twilight, etc.).
- Convert these hour angles to local times, adjusting for solar noon and the Equation of Time.
- For sun position at a specific time, calculate the current hour angle and then use spherical trigonometry to find azimuth and altitude.
Note: These calculations are approximations. Actual times can vary slightly due to local atmospheric conditions, elevation, and precise definitions. Timezones are based on your browser's local settings.
Input Parameters
Solar Data Results
Sunrise, Sunset & Day Length
Sunrise: --:-- (Local Time)
Solar Noon: --:-- (Local Time)
Sunset: --:-- (Local Time)
Day Length: --h --m
Twilight Times (Local)
Civil Twilight Start (Morning): --:-- | End (Evening): --:--
Nautical Twilight Start (Morning): --:-- | End (Evening): --:--
Astronomical Twilight Start (Morning): --:-- | End (Evening): --:--
Sun Position at --:-- on ----
Sun Azimuth: --.--° (from North, clockwise)
Sun Altitude/Elevation: --.--° (above horizon)