Solar Azimuth (Sun Compass Bearing)
The sun's compass bearing (clockwise from true north: 90 = east, 180 = south, 270 = west).
Example
You enter
- Latitude (deg, + north) 40
- Day of year (1-365; 172 = summer solstice) 172
- Hours from solar noon (- morning, + afternoon) -3
You get
- Solar azimuth (compass bearing) 99.81
- Solar altitude (for reference) 48.83
Details, formula, and sources
For any shadow-direction study. Uses the robust atan2 form: azimuth-from-south gamma = atan2(cos(dec) sin(H), cos(H) cos(dec) sin(lat) - sin(dec) cos(lat)), compass = 180 + gamma, with the declination from Cooper's equation and the hour angle H = 15 x (hours from solar noon). At solar noon the northern-hemisphere sun bears due south (180 deg); mornings are east of south, afternoons west, and a summer sunrise at 40 deg N sits well north of east. The shadow falls in the opposite direction. Pair it with solar-altitude to place the sun or aim a fixed panel. True solar time and a flat horizon assumed; the equation of time and refraction are separate. The actual sun path governs.
dec = 23.45 sin(360 (284 + n)/365); H = 15 (hours from solar noon); azimuth-from-south gamma = atan2(cos(dec) sin(H), cos(H) cos(dec) sin(lat) - sin(dec) cos(lat)); compass bearing = (180 + gamma) mod 360.
The solar azimuth (compass bearing) from the NOAA / Duffie & Beckman solar-geometry relations, with the declination from Cooper's equation, by name.
The solar-position equations are public-domain solar geometry (NOAA); the latitude, date, and time are the user's own site inputs.
Estimate. AHJ and licensed professional govern.
Field names used by the API: latitude_deg, day_of_year, hours_from_solar_noon, azimuth_deg, altitude_deg
- Azimuth gamma = atan2(cos(dec) sin(H), cos(H) cos(dec) sin(lat) - sin(dec) cos(lat)); compass = 180 + gammaNOAA / Duffie & Beckman solar geometry
- Declination / hour angle dec = 23.45 sin(360 (284 + n)/365) (Cooper); H = 15 x (hours from solar noon)solar geometry
- Scope compass bearing clockwise from true north; true solar time, flat horizon; refraction and equation of time separatescope of this tile