SOLVETUTORMATH SOLVER

Instrument MI-03-459 · Physics

Sunrise Sunset Calculator

Where the sun crosses your horizon depends on two angles only: how far you sit from the equator, and how far the sun has drifted from the celestial equator that day.

Instrument MI-03-459
Sheet 1 OF 1
Rev A
Verified
Type 03 — Astronomy SER. 2026-03459

Day length

12.000000 h

H₀ = acos(−tanφ·tanδ)

1.57079633 Sunrise/sunset hour angle, rad
6.000000 Sunrise, solar hours after midnight
18.000000 Sunset, solar hours after midnight
The working Every figure verified twice
  1. H0 = acos(−tan(0.698132)·tan(0)) = 1.57079633
  2. sunriseTime = 12 − 1.570796·3.819719 = 6.000000
  3. sunsetTime = 12 + 1.570796·3.819719 = 18.000000
  4. dayLength = 1.570796·3.819719·2·3600 = 43,200.000000
Worksheet log
  1. No entries yet — change an input to log a scenario.

How this instrument works

Sunrise and sunset are where the sun's daily circle — its apparent path around the sky as Earth turns — crosses the horizon. On the celestial sphere that circle sits at a fixed height called the declination, δ, the sun's angular distance north or south of the celestial equator. A short piece of spherical trigonometry, applied to the triangle formed by the pole, the zenith, and the sun at the horizon, collapses to one line: cos H₀ = −tanφ·tanδ, where φ is your latitude. Solve for H₀ and you have the hour angle — how far, in time, the sun sits from local solar noon at the moment it touches the horizon.

The negative sign carries the seasons. When latitude and declination share a sign — summer in your hemisphere — tanφ·tanδ is positive, its negative makes the cosine argument more negative, H₀ grows past 90°, and the sun stays up more than half the day. Flip either sign and the reverse happens: a shorter arc above the horizon, winter's short days. Earth turns 360° in roughly 24 hours, or 15° every solar hour, which is exactly the constant this instrument uses to turn the hour angle from an arc into sunrise and sunset offsets either side of noon.

The formula treats the sun as a point crossing a flat, sea-level horizon with no atmosphere in the way. Real air bends light by roughly 34 arc-minutes near the horizon, and the sun's disk itself spans about 32 arc-minutes, so a published almanac sunrise runs a few minutes earlier, and sunset a few minutes later, than the pure geometry computed here. And when |tanφ·tanδ| exceeds 1 — inside the polar circles during local summer or winter — there is no crossing at all: the cosine has no valid angle, and the honest answer is continuous daylight or continuous night, not a number.

H0=arccos(tanφtanδ)H_0 = \arccos(-\tan\varphi \cdot \tan\delta)sunrise=12H015\text{sunrise} = 12 - \dfrac{H_0}{15^\circ}sunset=12+H015\text{sunset} = 12 + \dfrac{H_0}{15^\circ}day length=sunsetsunrise\text{day length} = \text{sunset} - \text{sunrise}
H₀ — sunrise/sunset hour angle (radians internally, equivalent to degrees ⁄ 15 in hours) · φ — Latitude, degrees from the equator · δ — Solar declination, degrees from the celestial equator · sunrise, sunset — solar hours after midnight, 12.000000 is solar noon · day length — sunset minus sunrise, in hours.
  • Enter Latitude in degrees north (positive) or south (negative) of the equator; the field accepts any value from -90° to 90°.
  • Enter Solar declination for the date in question, from -23.45° near the December solstice to +23.45° near the June solstice, 0° at either equinox.
  • Check the Sunrise/sunset hour angle, rad — the computed half-arc the sun spends above the horizon, and the input every other result depends on.
  • Read Sunrise and Sunset, both given as solar hours after midnight, where 12.000000 marks local solar noon.
  • Read Day length directly in hours, or switch its unit to minutes for a finer figure.

Worked example — 40°N on the equinox

Set Latitude to 40° — Chicago, Madrid, and Beijing all sit near this parallel — and Solar declination to 0°, the sun's position at either equinox, when it crosses directly above the equator. The hour angle formula collapses at once: H₀ = acos(−tan 40°·tan 0°) = acos(−tan 40°·0) = acos(0) = 1.57079633 rad, exactly 90°.

Ninety degrees of hour angle, at 15° per solar hour, is exactly 6 hours on each side of noon. Sunrise reads 6.000000 (6:00 AM solar time), sunset reads 18.000000 (6:00 PM solar time), and day length comes out to 43200 seconds — 12.000000 hours, not a rounded approximation but the exact result of the algebra. That equal split of day and night is what gives the equinox its name, Latin for 'equal night.'

Questions

Why does the formula only need latitude and declination, not longitude or a date?

Because hour angle is purely a function of sun-Earth geometry at a given latitude and declination — longitude only shifts when solar noon lands in clock time, not how long daylight lasts. Declination already encodes the date: it swings from −23.45° at the December solstice to +23.45° at the June solstice, tracking the sun's drift along the ecliptic. Feed in a date's declination from an ephemeris and this instrument returns day length for any latitude on that date.

What happens above the Arctic Circle?

The term tanφ·tanδ can exceed 1 in magnitude, and acos has no real solution — that is the mathematics of the midnight sun or polar night. At 70°N with declination past roughly +20°, tan70°·tan20° is greater than 1, meaning the sun's daily circle never dips below the horizon at all. A correctly built instrument should flag this as undefined rather than return a wrong hour angle; the physical answer is 'sun up all day' or 'sun down all day,' not a number.

Does this match the sunrise time in a weather app?

Close, but not identical, because this formula gives the geometric sunrise — the instant the sun's center crosses the mathematical horizon — while published almanacs also correct for atmospheric refraction (about 34 arc-minutes of extra lift) and the sun's own angular radius (about 16 arc-minutes). Together those shift the practical sunrise a few minutes earlier and sunset a few minutes later than the pure geometry here, and neither accounts for hills or elevation.

Why is the result in solar hours after midnight instead of a clock time?

Because solar time and clock time agree only at one reference longitude, and this formula has no longitude input to place you on it. A sunrise value of 6.000000 means 6 hours before local solar noon — the moment the sun is due south (or north) and highest in the sky — not necessarily 6:00 AM on a wall clock, which is shifted further by your time zone, daylight saving, and the equation of time.

Who actually uses an hour-angle calculation like this?

Solar installers use it to estimate usable daylight per season when sizing a photovoltaic array's expected output; agricultural planners track day-length trends to time planting for photoperiod-sensitive crops; and celestial navigators once used this same spherical-trigonometry identity to recover latitude from an observed sunrise bearing. All three are asking the same geometric question: how much of the sun's daily circle sits above a given horizon.

Can declination be entered as a negative number?

Yes — a negative declination means the sun sits south of the celestial equator, which is the case from the September equinox through the March equinox in the northern hemisphere. The field spans the full physical range, −23.45° to +23.45°, matching Earth's 23.44° axial tilt; a value outside that range would not correspond to any real solar position all year.

References