Solar Azimuth Angle (Compass Bearing of the Sun)

Also known as sun azimuth · azimuth of the sun · sun compass bearing · sun direction from latitude declination and hour angle · where is the sun on the compass · bearing of the sun · solar azimuth from hour angle · tan A = sin H over cos H sin phi minus tan delta cos phi · sun azimuth atan2 · direction of the shadow · azimuth clockwise from north · astronomers azimuth westward from south · SPA azimuth equation 45 · solar azimuth for panel orientation

A=180∘+atan2⁡ ⁣(sin⁡H, cos⁡H sin⁡φ−tan⁡δ cos⁡φ)A = 180^\circ + \operatorname{atan2}\!\left(\sin H,\ \cos H\,\sin\varphi - \tan\delta\,\cos\varphi\right)
sig figs

Worked example: equinox sunrise at 45° N: H -90° → 90° (due east). Press Try an example to run it live, then adjust anything.

Enter your known values, leave one input blank, and solves for the missing one. Tap a variable’s symbol to see what it means, with a typical value. Change any unit and the answer follows.

Where Solar Azimuth Angle (Compass Bearing of the Sun) fits

Missing an input?

See also

Solar Elevation Angle (Height of the Sun above the Horizon): The height of the Sun above the horizon from the same three angles: the bearing and the height together fix where the Sun is.Solar Declination Angle (Cooper's Equation): Gives the declination for the day of the year, one of the three angles this page needs.Day Length from Latitude and Solar Declination (Sunrise Equation): Gives the hour angle at sunrise and sunset, and so the bearing of the Sun on the horizon through this page.Angle of Incidence on a Tilted Surface: Uses the Sun's position to find how squarely it strikes a tilted collector; this page adds the bearing it needs away from noon.Relative Optical Air Mass (Kasten and Young): How much air the sunlight crosses at the height that goes with this bearing.
Learning zone

Solar Azimuth Angle (Compass Bearing of the Sun) explained

NEWSApolehorizonφHδ

The Sun's bearing is the compass direction along the horizon at which it lies, measured clockwise from north: 90 degrees is east, 180 degrees south, 270 degrees west. The formula needs the latitude φ\varphi, the Sun's declination δ\delta and the hour angle HH, which is 0 degrees at solar noon, negative in the morning and positive in the afternoon, 15 degrees for each hour. This is spherical trigonometry, not a fit, so it is exact for the angles you give it.

The two-argument arctangent is the heart of it, as in NREL's Solar Position Algorithm (equations 45 and 46). The astronomers' azimuth Γ\Gamma is measured westward from south, and adding half a turn gives the bearing from north. Because atan2 keeps the sign of both of its arguments, it lands in the right quadrant in the morning and in the afternoon, and for a Sun north of the observer at noon in the tropics, which the arccosine form that NOAA's note prints cannot do without a rule about the sign of the hour angle. At latitude 10 degrees north, declination 20 degrees north and H=0H = 0, the second argument is 0.17365−0.35844=−0.184790.17365 - 0.35844 = -0.18479. It is negative, so the bearing is 0, due north.

The equinox is the easy check. At 45 degrees north the Sun rises due east, stands due south at noon and sets due west: 90, 180 and 270 degrees. At the sunrise hour angle of -90 degrees, cos⁡H\cos H is 0, so the bearing is exactly 90, which is the page's example. In NREL's Golden, Colorado example (17 October 2003, 12:30:30 local time) the report prints 194.34024 degrees; with its declination of -9.316179, hour angle of 11.10629 and latitude of 39.742476 degrees the page returns 194.340265. The gap is the report's own: its hour angle is 0.00002 above what its equation 40 gives, and the azimuth turns 1.26 degrees for each degree of hour angle.

This is the geometric bearing: atmospheric refraction lifts the Sun's apparent height near the horizon but moves its bearing by a negligible amount. Its accuracy is that of the declination and hour angle you give it, so take the declination from the declination page and the hour angle from solar time, which is clock time corrected for the longitude and the equation of time. A bearing is also given when the Sun is below the horizon, and it is undefined only at the zenith or the nadir, where every direction is the same.

Solar Azimuth Angle (Compass Bearing of the Sun) formula

A=180∘+atan2⁡ ⁣(sin⁡H, cos⁡H sin⁡φ−tan⁡δ cos⁡φ)A = 180^\circ + \operatorname{atan2}\!\left(\sin H,\ \cos H\,\sin\varphi - \tan\delta\,\cos\varphi\right)
Where
  • AA= Solar azimuth angle (°)
  • φ\varphi= Latitude (°)
  • δ\delta= Solar declination (°)
  • HH= Hour angle (°)
Where this comes from
  • Reda, I., and Andreas, A. (2008). Solar Position Algorithm for Solar Radiation Applications, NREL/TP-560-34302 (revised January 2008), National Renewable Energy Laboratory, a US Department of Energy laboratory report available at no cost. Section 3.13 (topocentric local hour angle, equation 40), section 3.15 (equation 45, the astronomers' azimuth Gamma = atan2(sin H', cos H' sin phi - tan delta' cos phi), measured westward from south; equation 46, Phi = Gamma + 180, measured eastward from north), Appendix A.1 (equation of time, equation A1) and Appendix A.5 Table A5.1 (the worked example: 17 October 2003, 12:30:30 local standard time, time zone -7, latitude 39.742476, longitude -105.1786). Read it
  • NOAA Global Monitoring Laboratory, "General Solar Position Calculations" (the Solar Calculator's equations note, a US federal work in the public domain): the fractional year gamma, the equation of time and declination as Fourier series in gamma, the true solar time, the hour angle ha = tst / 4 - 180, and the azimuth (degrees clockwise from north) by cos(180 - theta) = -[sin(lat) cos(zenith) - sin(decl)] / [cos(lat) sin(zenith)]. Read it
Revised 31 October 2026
Cite this page

formula.expert. (2026, October 31). Solar Azimuth Angle (Compass Bearing of the Sun) Calculator. https://formula.expert/solvers/solar-azimuth-angle