The sundial answers one question for any moment: does direct sun reach the monument? It works it out in three steps: where the sun is in the sky, whether a building stands in the way, and where that moment falls on the dial. Angles are in degrees unless noted.
ITime
A clock time in San Francisco is converted to Universal Time using the IANA time zone America/Los_Angeles, which handles daylight saving time. That instant becomes a Julian day and Julian centuries since the year 2000:
IIWhere the sun is
The sun's position follows the NOAA solar position equations, which are derived from Jean Meeus's Astronomical Algorithms. First, the sun's geometric mean longitude , mean anomaly and the eccentricity of Earth's orbit:
The equation of the center gives the sun's true longitude, corrected to its apparent longitude for nutation:
The tilt of Earth's axis (obliquity) gives the sun's declination :
The equation of time , in minutes, is how far the sun runs ahead of or behind the clock over the year, with :
True solar time (minutes) and the hour angle follow from the clock time in UTC minutes and the monument's longitude :
With the monument's latitude , the sun's altitude above the horizon and its azimuth (degrees clockwise from north) are:
Finally, atmospheric refraction lifts the sun slightly near the horizon. In arcseconds, added to :
The sun is up when .
IIIThe towers
A building at latitude and longitude is placed in meters east () and north () of the monument, which is accurate to well under a meter over the few hundred meters involved:
About 65 downtown towers within roughly 700 m are modeled as rectangular boxes, each with its published height , its location, and an estimated footprint. Boxes south of Market Street, where , are turned 45° to follow the South of Market street grid.
IVSun or shade
From a seated person's eye height at the monument, a line is traced along the ground toward the sun, in the direction . For each box, the distance at which the line first enters its footprint is found with the slab method. The line rises as it goes, so it is lowest where it enters, and the building blocks the sun exactly when its roof is above the line there:
This is checked every two minutes of the day, and consecutive sunny moments form the brass-lit windows. The building that ends each window is the nearest one that blocks the sun just after it.
VThe dial
The page draws a horizontal sundial set for . Its gnomon rises at angle and points north, and the shadow of its edge falls along the hour line at angle from the noon line for hour angle :
Because the hour lines come from the real sun, they're labeled with clock times, and with daylight saving time the sun crosses the noon line at about 12:56 pm. The gnomon's shadow tip is the point where the sun's rays through the top of the gnomon, at height , meet the plate, using the sun vector .
VIClouds and fog
The times above assume a clear sky. An hour counts as possibly cloudy or foggy when the Open-Meteo hourly forecast gives total cloud cover of at least 60% or low cloud of at least 70%. Those hours get the patina arc outside the dial, and while the dial shows one of them, fog drifts over it.
VIIAccuracy
The NOAA equations place the sun to within about one arcminute (1/60 of a degree). The larger uncertainty is the buildings: footprints are estimates, towers under about 87 m aren't included, and trees and awnings aren't modeled. Two days of readings in the plaza (October 14 and 19, 2026) agreed with the model to within about 10 minutes when the sun arrived, within 6 minutes when the plaza was half in sun, and within about 15 minutes when the last sun left. A version built from the city's measured building outlines fit worse, putting the midday shadow about half an hour early, so the simpler box model stays.
VIIISources
- NOAA Global Monitoring Laboratory, Solar Calculation Details and NOAA Solar Calculator: the solar position and refraction formulas in sections I–II.
- Jean Meeus, Astronomical Algorithms, 2nd ed. (Willmann-Bell, 1998): the source of the NOAA equations.
- Albert E. Waugh, Sundials: Their Theory and Construction (Dover, 1973): the horizontal dial and its hour lines.
- Timothy L. Kay and James T. Kajiya, “Ray Tracing Complex Scenes,” SIGGRAPH '86: the slab method for a line entering a box.
- Building heights and locations: Wikipedia, List of tallest buildings in San Francisco.
- Monument location: Wikipedia, Mechanics Monument; confirmed against OpenStreetMap.
- Time zones: the IANA Time Zone Database, through the browser's
IntlAPI. - Cloud forecast: Open-Meteo, hourly
cloud_coverandcloud_cover_low(CC BY 4.0).