# Daylight Ledger

> A year of daylight on one plate — closed-form solar declination feeding the half-day-arc formula to paint daylight and three twilight bands across latitude and date.

- Type: Lab Skill (downloadable Agent Skill)
- Category: [Interactive 3D](https://www.sandbase.ai/skills/interactive-3d)
- Version: 0.1.2
- Runs online: yes
- Page: https://www.sandbase.ai/skills/interactive-3d/daylight-ledger

## What you get

Bring a latitude and the year to chart. The Skill returns a downloadable Skill and a runnable daylight plate.

## Install

Download the Skill package from https://www.sandbase.ai/skills/interactive-3d/daylight-ledger (sign-in required), unzip it into your agent's skills folder, then ask your agent to use it:

```text
/daylight-ledger chart <your latitude and year> of daylight and twilight
```

## How it works

1. **Build the desk or lamp brief** Daylight Ledger builds from a brief in assets/briefs/: npm run build writes dist/index.html with the English desk brief, and npm run build:zh writes the Chinese lamp brief. Open dist/index.html directly or through any static server. The page runs offline in the browser, uses no location services and makes no model calls; latitude is chosen, never detected.
2. **Compute declination and twilight bands** decl(d) uses the J2000 approximation, from mean anomaly to ecliptic longitude to obliquity tilt, peaking at ±23.44 degrees. half(lat, δ, sinAlt) applies the half-day-arc formula at −0.833, −6, −12 and −18 degrees for daylight and civil, nautical and astronomical twilight. Almanac.sample fills four tables over 731 samples, and isolines draws 6, 9, 12, 15 and 18 hour contours.
3. **Shoot and read a day** npm run shoot serves dist/ with all network blocked and asserts the mechanism semantics. Then set a latitude with the meridian-arc dial or a city chip, and drag across the chart, the date rail or the arrow keys to move the hairline. Check that solstices land near day 171 and day 354 and that a polar latitude shows a midnight-sun or polar-night run label.

## FAQ

### What does Daylight Ledger chart?

Daylight Ledger charts a whole year of light for one latitude on a single almanac plate. Navy night with stars sits under three twilight bands and a daylight band in a sun gradient, with solstice and equinox rules. A hairline on the selected day reads its sunrise and sunset.

### Are the Daylight Ledger solstice dates hardcoded?

No. Daylight Ledger derives solstices and equinoxes from decl() itself: extrema fall near day 171 and day 354 and zero crossings at the equinoxes. The events row is computed from the declination formula rather than read from a table.

### How does Daylight Ledger detect midnight sun and polar night?

Daylight Ledger finds them in the band data. In the half-arc formula, a cosine of 1 or more means the sun never rises, and minus 1 or less means it never sets. run(k, test) then finds the longest such run, which gets a midnight-sun or polar-night label.

### Does Daylight Ledger use my location?

No. Daylight Ledger uses no network and no location services, so you pick the latitude with the meridian dial or city chips. Latitudes are clamped to ±89.99 so the pole never divides by zero.

### What are the Daylight Ledger date limits?

Daylight Ledger pins the year at construction with new Almanac(year) and uses a 365-day year. Its heat field evaluates the same formula on a 365 by 361 grid of day and latitude.

### Is Daylight Ledger free to use?

Yes. Daylight Ledger computes every band in the browser from closed-form formulas in src/almanac.js and makes no model calls at runtime. Building only fills the ledger template with the chosen brief's copy.

## Examples

- Daylight Ledger (scene)
- A Year of Light (video)
