Build a harmonograph ink plotter as a single static HTML page, 1280x720, no libraries. Two damped pendulums drive one pen: x = ax*sin(2*PI*fx*t + phx)*exp(-damp*t) and y = ay*sin(2*PI*fy*t + phy)*exp(-damp*1.06*t). Use ax 420, ay 305, fx 1.5, fy 1.003, phx 0, phy 1.2, damp 0.021, centered on the page, and plot 130 seconds in 1/220s steps as 0.85px line segments. Make the ink darker where the pen moves slowly, with alpha running from 0.26 to 0.96 by speed, so turns and the fading tail pool. Use iron-gall blue-black ink (22,32,66) on a seeded archival cream paper canvas with fine grain, short fibers, a soft vignette and a double plate-mark border, plus a small italic serif caption bottom left. Keep paper and ink on separate canvases and multiply the ink onto the paper. Static, no controls yet. Put the pendulum and plotting code in harmonograph.js.
the pen pools ink where it moves slowly, so alpha follows speed and the fading tail comes out darker. keep the second frequency a hair off (1.003) or the figure just retraces one closed loop.
// harmonograph.js, step 1: two damped pendulums, one fountain pen
const TAU = Math.PI * 2;
const swing = (amp, freq, phase, damp) => t => amp * Math.sin(TAU * freq * t + phase) * Math.exp(-damp * t);
function plotFigure(ctx, p) {
const X = swing(p.ax, p.fx, p.phx, p.damp); // pendulum 1 swings the table left-right
const Y = swing(p.ay, p.fy, p.phy, p.damp * 1.06); // pendulum 2 swings it front-back
const vmax = TAU * Math.max(p.ax * p.fx, p.ay * p.fy);
ctx.lineCap = 'round';
ctx.lineWidth = 0.85;
let px = p.cx + X(0), py = p.cy + Y(0);
for (let t = p.dt; t <= p.T; t += p.dt) {
const x = p.cx + X(t), y = p.cy + Y(t);
const speed = Math.hypot(x - px, y - py) / p.dt; // px per second
// a slow pen drags more ink onto the paper, so turns and the fading tail read darker
const a = 0.26 + 0.7 * Math.pow(1 - Math.min(speed / vmax, 1), 2);
ctx.strokeStyle = `rgba(${p.ink[0]},${p.ink[1]},${p.ink[2]},${a.toFixed(3)})`;
ctx.beginPath(); ctx.moveTo(px, py); ctx.lineTo(x, y); ctx.stroke();
px = x; py = y;
}
}






