Formula and Method for Sun Angle
The sun's position in the sky at any moment is described by two angles: the elevation angle (how high the sun sits above the horizon) and the azimuth angle (its compass direction). Both depend on the date (which sets the sun's declination), the observer's latitude, and the local solar time. This calculator applies the standard solar-position equations used in solar engineering and astronomy to compute elevation, zenith, declination, and azimuth from those three inputs.
How the calculation works
First, the calculator finds the day of year N from the date and computes the solar declination with Cooper's equation, δ = 23.45° × sin[360°(284+N)/365] — this tracks the 23.45° tilt of Earth's rotational axis, which is why declination is near +23.45° at the June solstice, near −23.45° at the December solstice, and 0° at the equinoxes. Next it converts local solar time to an hour angle, H = 15°×(t − 12), since Earth rotates 15° per hour and H = 0° at solar noon. The elevation angle α then follows from sin(α) = sinφ·sinδ + cosφ·cosδ·cosH, where φ is latitude. The zenith angle is simply 90° − α, and the azimuth angle (compass bearing from north) is recovered from cos(γ) = (sinδ − sinα·sinφ) / (cosα·cosφ), mirrored into the 180°–360° range for the afternoon (H > 0).
Local solar time vs. clock time
This calculator uses local solar time, where solar noon (the sun's highest point of the day) is always 12:00 — not the clock time on your phone or watch. Clock time differs from solar time because of time zones, daylight saving offsets, your exact longitude within the time zone, and the "equation of time" (a roughly ±16-minute wobble caused by Earth's elliptical orbit and axial tilt). For a rough estimate, solar noon typically falls near 12:00–13:00 local clock time; for precise sun-position work, apply a longitude and equation-of-time correction before entering a solar time here.