The idea: pendulums holding a pen

A harmonograph is a drawing machine. One pendulum swings the pen (or the paper) left and right, another swings it forward and back. Each pendulum moves like a sine wave, and friction slowly takes its energy away, so each swing is a little smaller than the one before. The pen draws

x(t) = A₁ sin(f₁t + p₁) e^(−d₁t) + A₂ sin(f₂t + p₂) e^(−d₂t)
y(t) = A₃ sin(f₃t + p₃) e^(−d₃t) + A₄ sin(f₄t + p₄) e^(−d₄t)

A is how far a pendulum swings, f how fast (in radians per second), p where it starts, and d how quickly friction stops it. The page uses one d for all four pendulums, so the formula becomes x = (A₁ sin(f₁t + p₁) + A₂ sin(f₂t + p₂))·e^(−dt), and t runs from 0 to 100.

Top left: x(t) = sin(t + π/2)·e^(−0.03t), a sine wave whose peaks shrink inside a dashed envelope. Bottom left: y(t) = sin(t)·e^(−0.03t), the same shape a quarter wave later. Right: the pen's path (x, y), a circle that spirals in towards the centre, purple at the start and orange at the end
Two shrinking sine waves, one for x and one for y, make the pen spiral inward.

On the canvas the x wave is drawn under the figure with time running down (blue), the y wave beside it with time running right (green), and grey links show the pen taking its x from one and its y from the other, the same layout as Lissajous Figures. The ink changes colour with time, purple at t = 0 to orange at t = 100, so you can see which loops came first.

No damping, exact ratio: a Lissajous figure

Set d = 0 and give f₁ : f₃ a whole-number ratio a : b, like 2 : 1 or 3 : 2. Then both waves come back to where they started after the same time, and the pen goes round the same closed curve again and again: a Lissajous figure. Over t = 100 the 2 : 1 eight is drawn about 15 times on top of itself, so it looks like one thin line. (Demo: no damping, exact 2 : 1: a plain Lissajous figure.) The ratio still sets the shape: x makes a waves while y makes b, so the figure touches the side edges a times and the top b times.

Damping: the figure spirals inward

With d > 0 every term is multiplied by e^(−dt), the same factor for x and y. So the pen draws the same figure, only scaled down a little more on every lap: it spirals inward to the centre. The dashed box on the canvas is the envelope ±(A₁ + A₂)·e^(−dt) at the current t, and it shrinks with the pen. The half-life, the time for the swing to halve, is ln 2 / d.

dampingdhalf-life ln 2 / dsize left at t = 100
none0never1
light0.0169.3e^(−1) = 0.37
heavy0.0323.1e^(−3) = 0.05

Light damping leaves wide, evenly spaced loops; heavy damping packs most of the drawing near the centre. (Demo: 1 : 1 with damping: the circle spirals inward, Demo: damping none → light → heavy.) The same shrinking envelope, for one wave on its own, is on Damped Oscillation.

Detuning: the figure turns

Now make the ratio almost but not quite whole: f₁ : f₃ = 2 : 1.005 instead of 2 : 1. Write y = sin(1.005t) as sin(t + 0.005t): it is the 2 : 1 wave with a phase that slowly grows. The shape of a Lissajous figure depends only on the phase difference between the waves, so each lap is the 2 : 1 figure for a slightly different phase: the figure seems to turn, or precess.

For a ratio a : b with ε added to f₃, the phase difference drifts at a·ε radians per second, and the figure goes through the same shapes again every 2π / (a·ε) seconds. This is a beat: two tones a little out of tune drift in and out of step at their frequency difference, and you hear it as a slow pulse.

presetaεdrift over t = 100
2 : 1 figure eight20.0051.0 rad (57°)
1 : 1 turning ellipse10.033.0 rad (172°)
3 : 4 lattice, ε = 0.0330.039.0 rad, more than one full turn
Top: the phase difference grows in a straight line, 0.03 rad per second, from 0 at t = 0 to 3 rad at t = 100. Bottom: the 1 : 1 figure at five moments: a line along y = x at phase 0, an ellipse leaning right at 0.75, a circle at π/2, an ellipse leaning left at 2.25 and almost the line y = −x at 3
1 : 1.03: the phase difference grows by 0.03 per second, so one lap is a line, a later one an ellipse, then a circle.

(Demo: detune turns the ellipse: 1 : 1.03, no damping; Demo: detune exact → 0.005 → 0.01 → 0.03.) With no damping and a detune, the figure keeps its size and slowly fills the square as it turns. Add damping and the turning figure also spirals in: that is the look of most harmonograph drawings.

Three pictures compared

Three drawings of the 2 : 1 figure eight from t = 0 to 100. Left, d = 0 and exact 2 : 1: one thin figure eight. Middle, d = 0.01 and exact 2 : 1: nested eights spiralling in, all upright. Right, d = 0.01 and 2 : 1.005: nested eights that spiral in and turn as they go
Same pendulums: exact and undamped (a Lissajous figure), damped (spirals in), damped and detuned (spirals in and turns).

The presets

presetxydamping, detune
1 : 1 spiralsin(t + π/2)sin(t)light, exact
2 : 1 figure eightsin(2t)sin(t)light, +0.005
3 : 2 pretzelsin(3t + π/2)sin(2t)light, +0.005
3 : 4 latticesin(3t + π/4)sin(4t)light, +0.005
1 : 1 turning ellipsesin(t + π/4)sin(t)light, +0.03
four pendulums: star0.6 sin(2t) + 0.4 sin(3t + π/2)0.6 sin(2t + π/2) + 0.4 sin(3t)light, +0.01
four pendulums: swirl0.6 sin(2t + π/2) + 0.4 sin(t)0.6 sin(2t) + 0.4 sin(t + π/2)heavy, +0.01

The detune is always added to f₃, the first y pendulum. With two pendulums on each axis the pen adds two motions, a slow wide one and a faster small one, which gives the stars and swirls their points and loops. (Demo: four pendulums draw a star.)

Real harmonographs

Harmonographs grew out of Hugh Blackburn's Y-shaped pendulum (1844) and Jules Lissajous's mirrors on tuning forks (1857), and became a favourite in Victorian drawing rooms. A lateral harmonograph has two pendulums swinging at right angles: one moves the pen arm, the other the paper. A rotary harmonograph hangs the table on a gimbal so it can swing in any direction, and a push round in a circle gives the circular terms like those in the four-pendulum presets.

A pendulum's angular frequency is √(g/L), so it depends only on the length L (Simple Pendulum). To get 2 : 1 the slow pendulum must be 4 times as long, for 3 : 2 the lengths are 4 : 9. Nobody can set the lengths exactly, so real drawings are almost always a little detuned and turn, and friction in the bearings and the pen on the paper is the damping that pulls the drawing to the centre.

Many small pendulums, ideal and damped, still give these regular pictures. Join two pendulums end to end instead and the motion becomes chaotic: see The Double Pendulum. Other curves drawn by a moving pen: Spirograph (rolling circles, no damping).

How the page draws it

The curve is computed at 6000 points (60 per unit of t, about 94 per wave even at f = 4) and drawn in 60 colour bands. Play: draw moves the pen from t = 0 to 100 in 250 steps of 0.4; the speed choice makes that about 25, 13 or 4 seconds. Nothing is random, so step back and undo give the same picture.

What the page leaves out

Separate damping for each pendulum (d₁ … d₄), amplitudes and phases as controls, the real physics of a pendulum (big swings are slower, so the frequency changes as the swing dies), the coupling between pendulums on one frame, the gimbal geometry of a rotary harmonograph (the pen moves on a sphere, not a plane), the paper's own swing and the width of the ink line. The window is fixed at −1.1 … 1.1.