Sun Position Calculator
The sun position calculator determines the sun's altitude and azimuth angles for any given location and time. This information is essential for solar energy applications, astronomy, and outdoor activities.
What is Sun Position?
The sun's position in the sky is defined by two key angles: altitude and azimuth.
- Altitude is the angle between the sun and the horizon, measured in degrees above the horizon.
- Azimuth is the compass direction of the sun, measured in degrees from north (0°) clockwise to east (90°), south (180°), and west (270°).
These angles change throughout the day and vary with the season and latitude of the observer. The calculator uses precise astronomical algorithms to determine these values.
How to Use This Calculator
To calculate the sun's position:
- Enter your location's latitude and longitude.
- Select the date and time for which you want to calculate the sun's position.
- Click "Calculate" to see the results.
The calculator will display the sun's altitude and azimuth angles, along with a visual representation of the sun's path throughout the day.
Formula Used
The calculator uses the following formulas to determine the sun's position:
- Calculate the day of the year (n) from the date.
- Compute the solar declination (δ) using:
δ = 23.45° × sin(360° × (284 + n)/365)
- Determine the hour angle (H) based on the local time and longitude.
- Calculate the solar altitude (α) with:
α = arcsin(sin(φ) × sin(δ) + cos(φ) × cos(δ) × cos(H))
where φ is the latitude. - Compute the solar azimuth (A) using:
A = arctan2(sin(H), cos(H) × sin(φ) - tan(δ) × cos(φ))
These formulas account for the Earth's tilt and orbital position to provide accurate results.
Worked Example
Let's calculate the sun's position for New York City (40.7128° N, 74.0060° W) on June 21 at 12:00 PM (noon).
- Day of the year (n) = 172 (June 21)
- Solar declination (δ) = 23.45° × sin(360° × (284 + 172)/365) ≈ 23.44°
- Hour angle (H) = 0° (noon)
- Solar altitude (α) = arcsin(sin(40.7128°) × sin(23.44°) + cos(40.7128°) × cos(23.44°) × cos(0°)) ≈ 73.5°
- Solar azimuth (A) = arctan2(sin(0°), cos(0°) × sin(40.7128°) - tan(23.44°) × cos(40.7128°)) ≈ 180° (south)
At this time, the sun is directly overhead in New York City, with an altitude of approximately 73.5° and an azimuth of 180° (south).