Machines of Wonder · 3 of 4

Draw me a Wankel rotor

The only engine where the chamber wall and the moving part are the same curve. You asked Claude. Glyph drew it. An epitrochoid for a housing, a triangular rotor that sweeps three working chambers per revolution, and three explosions per turn instead of one.

▸ The prompt
"Draw me a Wankel rotary engine housing. Use the Glyph viz grammar with a parametric function: x(t) = R·cos(t) + e·cos(3t), y(t) = R·sin(t) + e·sin(3t) — the classic epitrochoid with a 1:3 frequency ratio, R = 4 and e = 1. Pencil-sketch style. Beautiful enough for a child to see the three lobes; clear enough that an engineer recognizes why a triangular rotor with rounded sides exactly fits."

— what to say to your AI agent. Claude writes the Glyph spec; the compiler samples the epitrochoid 400 times around one revolution.

A Wankel rotor turning inside its epitrochoid housing A pencil-style technical drawing: a three-lobed chamber housing (an epitrochoid) on the left half of the canvas; a triangular rotor with rounded sides spins inside, its three apexes always touching the housing wall; on the right, the housing curve plotted in graphite ink with the rotor-apex trace highlighted. FIG. III. Wankel epitrochoidal housing — x(t) = R·cos(t) + e·cos(3t), R = 4, e = 1 — SWEEPS / REV 3 working chambers
8 seconds per output-shaft revolution · 24 s per rotor revolution · the three apexes always touch the housing — that's the defining property of the design

Why a 1:3 ratio?

The Wankel housing isn't just any closed curve — it's the specific epitrochoid generated by a 1:3 frequency ratio. That ratio is what guarantees a triangular rotor can sweep the chamber with no gaps and no overlaps.

RATIO 1:1
cos(t) + cos(t)

A bigger circle

At a 1:1 ratio the two cosines just sum — you get a translated circle. No lobes. No room for a polygon rotor to sweep different volumes at different angles.

RATIO 1:2
cos(t) + cos(2t)

A cardioid (2 lobes)

One bump, one indentation. A two-sided "rotor" could fit but produce only two working chambers per revolution — worse than a piston engine. Not used.

RATIO 1:3
cos(t) + cos(3t)

The Wankel chamber

Three lobes. A triangular rotor sweeps three working chambers per revolution — intake, compression, combustion, and exhaust all happening in three places at once. The geometry IS the engine cycle.

How Glyph drew it

Claude writes the JSON; Glyph samples the epitrochoid 400 times around one full revolution and emits the housing outline. Same spec → byte-identical SVG, every platform, every run.

The Glyph spec JSON

// wankel-rotor.json — epitrochoidal housing curve
{
  "version": "glyph/0.1",
  "title": "Wankel rotor housing",
  "data": {
    "function": {
      "shape": "function",
      "parameter": { "name": "t",
                     "min": 0,
                     "max": 6.283185307179586,
                     "samples": 400 },
      // epitrochoid: 1:3 frequency ratio
      "xExpr": "4*cos(t) + cos(3*t)",
      "yExpr": "4*sin(t) + sin(3*t)"
    }
  },
  "layers": [{
    "mark": "line",
    "encoding": {
      "x": { "field": "x" },
      "y": { "field": "y" }
    }
  }]
}

Change 3 to 2 or 4 and you get a different chamber count. Real Wankel engines use ratios slightly off integer (e.g. 2:3 with eccentricity scaling) to leave room for apex seals — but the 1:3 idealisation captures the soul of the design. View on GitHub.

Glyph compiler output SVG

Glyph-rendered Wankel epitrochoid housing curve, byte-locked across CI

Byte-stable across Ubuntu / macOS / Windows × Node 20 / 22. The three-lobed symmetry is in the data — a 1/3-rotation map of the curve onto itself.

Your turn — prompts to try

Trochoidal curves describe a huge family of engines, pumps, and gears. Tell Claude the chamber count, the ratio, or the application.

▸ Gear pump
"Draw me a gerotor pump — like a Wankel but with an inner and outer rotor with one more lobe outside than inside. Show the chambers sweeping fluid around."
▸ Spirograph
"Plot a hypotrochoid family: same outer circle, but vary the inner radius from 1 to 5. Show how the curve goes from a near-circle to a rosette."
▸ Engine variant
"Show me the trochoid for a 2:3 Wankel — two-lobed instead of three. Used in air-conditioning compressors. Side-by-side with the 1:3 automotive Wankel."
▸ Apex trajectory
"Trace the path of a single rotor apex as the rotor turns through one revolution. Overlay the trace on the housing — show that the rotor apex IS the curve that defines the housing."

More Machines of Wonder

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