Shadow of a latitude-inclined gnomon on a stone dial, with the equation of time, longitude and daylight-saving corrections.
GraphsHour-line angle versus solar time at this latitude (red dot: measured from the ray-cast shadow)
Equation of time through the year
Shadow-tip curves on the dial plane
The science
Solar position. For latitude φ, solar declination δ and hour angle H = 15 deg x (solar time - 12 h), the sun's altitude follows sin(alt) = sinφ sinδ + cosφ cosδ cos H; its direction components east, up and north are (-cosδ sin H, sin alt, cosφ sinδ - sinφ cosδ cos H). The declination comes from Spencer's 1971 Fourier series in the day angle Γ = 2π(n - 1)/365.
Apparent solar time. The sundial shows apparent solar time. Clock time differs by the equation of time E (minutes; also a Fourier series in Γ, amplitude about 16 min, caused by the tilt and eccentricity of Earth's orbit), by 4 minutes per degree of longitude away from the time-zone meridian, and by one hour in daylight-saving time: Tsolar = Tclock + (4Δλ + E)/60 - DST.
Horizontal dial. The gnomon's style edge points at the celestial pole, so it is inclined at the latitude angle φ above the horizontal and runs north. The shadow of the style edge lies along the hour line with angle tan(HLA) = sinφ tan H measured from the north line. The lines crowd together as the latitude falls. The red marker is the shadow of the gnomon's tip, computed by projecting the tip along the sun's ray onto the dial plane; the real shadow in the scene comes from the shadow map, so both can be compared.
Tip curves. The shadow tip traces a conic section: a hyperbola on most days, a straight line at the equinoxes (declination zero). The three coloured curves on the dial are the summer solstice (red), equinox (blue) and winter solstice (green).
Honest simplifications. No atmospheric refraction (about 0.6 deg at the horizon), no penumbra width from the sun's 0.53 deg diameter, no change of δ and E during a day, and the dial is assumed perfectly level and aligned to true north. The latitude slider covers the northern hemisphere only; a southern dial is mirrored with the gnomon pointing south.
What to try: set latitude to 5-20 deg and see the hour lines spread; run the year at 12:00 and watch the shadow swing east and west with the equation of time; set the longitude offset to +10 deg to see a 40-minute offset between clock and dial; compare the tip curves at 66 deg N, where the sun stays up all summer.