From 76bdd2db8794202fddba0f0bafd8470bb9e493b0 Mon Sep 17 00:00:00 2001 From: zyphlar Date: Sat, 10 Oct 2026 00:53:41 -0700 Subject: [PATCH] Quarter-globe dial, restore wedge shadow with gnomon base at its origin, center the clepsydra pointer on the drum --- index.html | 73 ++++++++++++++++++++++-------------------------------- 1 file changed, 30 insertions(+), 43 deletions(-) diff --git a/index.html b/index.html index a899f6b..c5e81e7 100644 --- a/index.html +++ b/index.html @@ -156,7 +156,6 @@ .hit { stroke: transparent; stroke-width: 16; fill: none; pointer-events: stroke; cursor: pointer; -webkit-tap-highlight-color: transparent; } .hit:focus { outline: none; } .horizon-line { stroke: var(--dial-line); stroke-width: 1; opacity: .6; } - .rod-shadow { stroke: var(--shadow-hand); stroke-width: 3.5; stroke-linecap: round; fill: none; filter: url(#soft); } .curve-info { min-height: 2.6em; margin: 2px 8px 0; text-align: center; font-size: 13px; line-height: 1.35; color: var(--muted); } .curve-info b { color: var(--text); font-weight: 600; } .drum-shade { pointer-events: none; } @@ -351,46 +350,39 @@
- + Spherical sundial - - - - - - - - + + + - - - + + + - - - - - - - - - + + + + + + + + - - - - - - + + + + + @@ -435,8 +427,8 @@ - - + +
@@ -477,9 +469,9 @@ Romans split the daylight, from sunrise to sunset, into twelve equal horae, and the night into twelve more, grouped into four watches (vigiliae). So an hour stretched in summer and shrank in winter. - By day this page draws a spherical sundial, a hollow stone globe cut open toward the equator, - laid out for your latitude. A bronze gnomon hangs from the top of the opening to the centre of the sphere, - and its tip's shadow marks the hour. The three curves are the winter solstice (bruma), the + By day this page draws a spherical sundial: the lower quarter of a hollow stone globe, open toward the equator, + laid out for your latitude. A bronze gnomon points out from the centre of its upper edge, + and its shadow marks the hour. The three curves are the winter solstice (bruma), the equinox (aequinoctium) and the summer solstice (solstitium); the dashed line is today's path. By night, when a sundial is useless, it switches to the water clock of Ctesibius (Vitruvius IX.8): water drips at a steady rate into a cylinder, and a float lifts a figure whose wand points to the hour @@ -577,7 +569,7 @@ // of the tip lands diametrically opposite the sun. Everything works in a "dial frame": latitude is // taken as |lat| and, south of the equator, declination and east-west are mirrored so the dial faces north. const svgNS = "http://www.w3.org/2000/svg"; - const CX = 200, CY = 166, R = 140, SOLSTICE = 23.44 * rad, REFRACTION = -0.833 * rad; + const CX = 200, CY = 30, R = 150, SOLSTICE = 23.44 * rad, REFRACTION = -0.833 * rad; const el = (tag, attrs, parent) => { const e = document.createElementNS(svgNS, tag); for (const k in attrs) e.setAttribute(k, attrs[k]); @@ -602,13 +594,6 @@ const s = sunVec(lat, dec, f, halfDay); return toScreen(-s.e, Math.min(0, -s.u)); } - // Shadow of the hanging rod (from the top of the opening down to the centre) on the inner sphere. - function rodShadow(s) { - return range(0, 1, 24).map(h => { - const b = h * s.u, t = b + Math.sqrt(Math.max(0, b * b - h * h + 1)); - return toScreen(-t * s.e, h - t * s.u); - }); - } const toPath = pts => 'M' + pts.map(p => p[0].toFixed(1) + ',' + p[1].toFixed(1)).join('L'); const range = (a, b, n) => Array.from({ length: n + 1 }, (_, i) => a + (b - a) * i / n); const romanHourMin = (lat, dec) => { @@ -792,8 +777,10 @@ if (activeCurve === 'today') $('curveInfo').innerHTML = curveText('today'); const sun = sunVec(place.lat, dec, frac, Math.PI * (per.end - per.start) / dayMs); sun.u = Math.max(0, sun.u); - $('shadow').setAttribute('d', toPath(rodShadow(sun))); const [tx, ty] = toScreen(-sun.e, -sun.u); + const dx = tx - CX, dy = ty - CY, len = Math.hypot(dx, dy) || 1; + const nx = -dy / len, ny = dx / len; + $('shadow').setAttribute('d', `M${CX + nx * 2.5},${CY + ny * 2.5} L${tx + nx * .8},${ty + ny * .8} L${tx - nx * .8},${ty - ny * .8} L${CX - nx * 2.5},${CY - ny * 2.5}Z`); $('shadow').style.display = $('tip').style.display = ''; $('tip').setAttribute('cx', tx); $('tip').setAttribute('cy', ty); @@ -804,7 +791,7 @@ function drawNight(now, frac, idx) { $('sundial').toggleAttribute('hidden', true); $('clepsydra').toggleAttribute('hidden', false); - $('curveInfo').innerHTML = 'The drum turns once a year; today faces the pointer'; + $('curveInfo').innerHTML = ''; buildDrum(place.lat, now); const rise = Math.min(TRAVEL, frac * nightFrac(place.lat, now) / maxNight * TRAVEL); waterY = 380 - rise;