Machines of Wonder · 4 of 4

Draw me the Antikythera
Mechanism

A 2,000-year-old analog computer, animated from one English sentence. You asked Claude. Glyph drew it. Bronze gears, ground by hand, that predicted lunar eclipses to within a few hours — sixteen centuries before the next mechanical computer would exist.

▸ The prompt
"Draw me the Antikythera Mechanism's Moon-pointer output. Use the Glyph viz grammar with a parametric function: x(t) = R₁·cos(t) + R₂·cos(13t), y(t) = R₁·sin(t) + R₂·sin(13t) — a deferent + epicycle, matching Hipparchus's 2nd-century-BCE lunar theory. R₁ = 5, R₂ = 1.2. Pencil-sketch style. A child should see the looping flower-pattern; a historian should recognize the same Saros 223:235 ratio the original bronze gears encoded."

— what to say to your AI agent. Claude writes the Glyph spec; the compiler samples the compound epicycle 800 times around one solar year.

Compound epicycles tracing the Moon's longitude A pencil-style technical drawing: on the left, the deferent gear (larger, slowly rotating) carries the epicycle gear (smaller, rotating 13× faster); together they trace a flower-like pattern; on the right, the resulting Moon-longitude trace plotted over one solar year. FIG. IV. Compound epicycle — Hipparchus's lunar theory, in bronze — Moon-pointer trace · 1 solar year ≈ 12 lunar months per loop
60 seconds per solar year · the Moon pointer traces the same flower pattern the original bronze gears computed

One year, twelve loops

Sum two circular motions at integer-ratio frequencies and you get a flower. Antikythera doesn't just decorate — those flower-petals correspond to the Moon's monthly passes around the sky, and a pointer running on the output gear tracks the Moon's actual position to within a fraction of a degree.

GEAR 1
deferent

The slow circle

The main wheel turns once per solar year — driven by a hand crank on the front of the mechanism. Original tooth count: 64. This represents the average annual motion through the zodiac.

GEAR 2
epicycle

The fast circle

A smaller gear mounted on the deferent, geared to spin 13 times for every revolution of the parent. Original tooth count: 50. This represents the Moon's faster orbital motion against the background of the stars.

OUTPUT
Saros 223 : 235

Eclipse prediction

Combining the two motions through additional gear stages, the mechanism predicts when the Moon, Sun, and Earth align. The Saros cycle (223 lunar months ≈ 235 synodic months) repeats eclipses every 18 years; the Antikythera dial pre-printed the date of each one.

How Glyph drew it

Claude writes the JSON; Glyph samples the compound epicycle 800 times around one solar year and emits the trace. Same spec → byte-identical SVG, every platform, every run.

The Glyph spec JSON

// antikythera-moon.json — compound epicycle, R₁:R₂:freq = 5:1.2:13
{
  "version": "glyph/0.1",
  "title": "Antikythera Moon trace",
  "data": {
    "function": {
      "shape": "function",
      "parameter": { "name": "t",
                     "min": 0,
                     "max": 6.283185307179586,
                     "samples": 800 },
      // deferent (annual) + epicycle (13× faster)
      "xExpr": "5*cos(t) + 1.2*cos(13*t)",
      "yExpr": "5*sin(t) + 1.2*sin(13*t)"
    }
  },
  "layers": [{
    "mark": "line",
    "encoding": {
      "x": { "field": "x" },
      "y": { "field": "y" }
    }
  }]
}

Try 13 → 12 (twelve petals, even more flower-like), 7 (less symmetric, but matches Mercury's actual orbital ratio), or 235/19 ≈ 12.37 (the Metonic cycle — never closes, drifts each year). The two-thousand-year-old gear ratios are still the right ones. View on GitHub.

Glyph compiler output SVG

Glyph-rendered Antikythera compound-epicycle Moon trace, byte-locked across CI

Byte-stable across Ubuntu / macOS / Windows × Node 20 / 22. Twelve clean lobes, one for each lunar month. The same astronomical knowledge that survived a Roman shipwreck — restored as 800 floating-point samples.

Your turn — prompts to try

Compound circular motion describes a huge swath of astronomy and engineering. Tell Claude the body, the cycle, or the gear count.

▸ Planet
"Show me Mars retrograde motion as seen from Earth. Two circular orbits (Earth at 1 AU, Mars at 1.52 AU); plot Mars's apparent position against the stars over two years. The looping retrograde paths are the Antikythera's planetary dials in action."
▸ Spirograph
"Draw a Spirograph rosette with a 7:1 gear ratio. Inner gear radius 1, outer gear radius 5, pen offset 3. Show the petal pattern."
▸ Tidal forecasting
"Plot Lord Kelvin's tide-predicting machine output: sum of 12 sinusoids with different frequencies and amplitudes (the dominant tidal constituents M2, S2, N2, K1, O1, …). Show how the composite predicts the tide at any port."
▸ Music
"Draw a Lissajous figure for a perfect fifth (3:2 frequency ratio) and an octave (2:1). Side by side. Animate the trace so the viewer sees the closed curves form."

More Machines of Wonder

See all of Life in Glyph ↗ Watt's Steam Engine Huygens' Pendulum Wankel Rotor