FRENAR
N°03 · Canvas 2D · Visual Mathematics

Lissajous

Two perpendicular sinusoidal oscillations draw harmonic figures. The frequency ratio determines the topology — from a line to an infinite knot.

adjust frequencies and phase
// Lissajous — harmoniques visuelles
let t = 0;

function draw() {
  const x = cx + amp * Math.sin(freqX * t + phase);
  const y = cy + amp * Math.sin(freqY * t);

  ctx.lineTo(x, y);
  ctx.strokeStyle = 'rgba(200, 241, 53, 0.7)';
  ctx.stroke();

  t += 0.005;
  requestAnimationFrame(draw);
}
Your turn

Which freqX/freqY ratio produces a perfect circle? Try 3:2 vs 5:4 — which produces the more complex pattern? Push the trail to maximum to reveal the full figure.

Mathematics in the service of generative art

Book a session