BONEYARD · part · bay
Terminator
src/45-terminator.js · one module, no third-party code
ParametersFactory
How it works
Two Fibonacci spheres give the dots: a sparse one kept over ocean and a dense one kept only where the land mask has a bit set, so continents read as crowded, brighter dots. Behind them, the visible half of the sunlit hemisphere is an exact projected path: the front half of the terminator great circle closes along the sunward limb. The mask is 360 x 180 bits, row 0 at 90 N, column 0 at 180 W; it loads after mount, and the globe redraws when it arrives.
The sun: from days since J2000 the sun's mean longitude and mean anomaly give its ecliptic longitude, then its declination and right ascension. The equation of time is mean longitude minus right ascension. The sub-solar point is at latitude = declination and longitude = 180 - 15 x UTC hours - equation of time (in degrees). Each dot's brightness is ambient plus the Lambert term max(0, n . s), binned into a handful of alpha levels so the whole globe is about twenty fills. Dots with a negative view-space z are behind the globe and are culled. The polar axle, equator and projected sun sight all use the same rotated vectors, so the instrument cage carries real orientation.
Rotation brings Tucson (32.22 N, 110.97 W) to the centre of the disc. A horizontal drag (touch only once it is clearly sideways) spins the globe about its axis; released, it waits and eases back to face Tucson. Nothing moves on its own: the sun is recomputed every few seconds and the frame is redrawn only when something changed.
Provenance
- technique
- a back-culled dotted sphere in orthographic projection with a filled solar hemisphere, graticule and axis cage; land is denser dots from a 1-degree mask, lit by the real sub-solar point
- lineage
- Elite's dotted planets (David Braben and Ian Bell, Acornsoft, 1984); the IRIX-era wireframe globe (Silicon Graphics workstations, early 1990s)
- original
- the sun is computed, not animated: solar declination plus the equation of time from the visitor's clock place the sub-solar point, and the readout prints it with the sun's real altitude over Tucson, whose one dot is amber; the projected terminator encloses the exact visible day hemisphere, the poles and equator orient the sphere, and an amber sight marks the screen-plane direction of the sun; the globe is centred on the shared vanishing point; drag spins it and it comes home to face Tucson
- not
- precise: the low-precision solar formulas (Astronomical Almanac style) are good to about 0.1 degree, but the drawn day line is a sharp Lambert edge with no refraction or twilight, which puts the visible line up to about a degree from where the sun actually sets. The land mask is Natural Earth 110m rasterised to 1 degree, so small islands and narrow coasts are coarse. No city lights: there is no data for them here, so the night side is simply dim.
- deps
- none · Canvas 2D · 2026-09
- budget
- 1.80 ms/frame active drag @ 1440x900 internal; 1.57 ms/frame @ 390x844; fourfold CPU slowdown, local Chromium parts harness (2026-09-30); idle redraws only on change; phone hardware TBD
- api
- mount(canvas, params, ctx) -> { tick(dt, t, progress, pointer), resize(w, h, dpr), still(t), destroy() }
- license
- MIT, Desert Data Labs LLC
Budget: 1.80 ms/frame active drag @ 1440x900 internal; 1.57 ms/frame @ 390x844; fourfold CPU slowdown, local Chromium parts harness (2026-09-30); idle redraws only on change; phone hardware TBD