How sunrise & sunset calculator works
Enter a date plus a latitude and longitude — from a map pin, a GPS readout or an atlas — and the calculator runs the NOAA solar equations. Earth's position on its orbit for that day yields two numbers: the sun's declination (how high it climbs) and the equation of time (how far the true sun runs ahead of or behind the clock). Those turn your coordinates into the exact instants the sun's centre crosses the horizon allowance of 0.833 degrees, which folds in atmospheric refraction and the sun's apparent radius, and back down again.
The same math gives solar noon — the moment the sun crosses your meridian, which is rarely 12:00 on the clock because of your longitude inside the time zone and the equation of time — plus solar midnight, civil dawn and dusk (the sun 6° below the horizon) and total day length. The computation refines each event at its own instant rather than at midnight, which keeps the answers within about a minute of published almanac tables.
Near the poles the geometry degenerates gracefully instead of failing: inside the Arctic or Antarctic circles in summer the tool reports "sun up all day" (the midnight sun), in winter "sun down all day" (polar night), and even in polar night it can show the civil-twilight window when the sun climbs within 6° of the horizon.