〰️ Lissajous Figures
Two oscillations — one hypnotic curve. Change the frequencies and watch the shape transform!
Two oscillations — one hypnotic curve. Change the frequencies and watch the shape transform!
This simulation traces a Lissajous figure: the path drawn when two perpendicular harmonic oscillations are combined. The horizontal and vertical positions follow x(t) = A·sin(fxt + δ) and y(t) = B·sin(fyt), where fx and fy are the angular frequencies and δ is the phase offset. As the parameter t advances, the point sweeps out a closed curve sampled here over 1500 line segments.
The sliders set Frequency X and Frequency Y (integers from 1 to 10) and the Phase δ, while presets jump to classic shapes such as the figure-8, flower, star and knot. A colour-scheme menu and an “Animate δ” button sweep the phase continuously. Lissajous figures appear on oscilloscopes used to compare two signals' frequency and phase, and in audio, optics and mechanical-vibration analysis.
What is a Lissajous figure?
A Lissajous figure is the curve traced by a point whose horizontal and vertical motions are two independent sine waves at right angles. The resulting shape depends on the ratio of the two frequencies and the phase difference between them. They are named after the French physicist Jules Antoine Lissajous.
What equations does this simulation use?
The point follows x(t) = A·sin(fxt + δ) and y(t) = B·sin(fyt). Here fx and fy are the X and Y frequencies, δ is the phase, and A and B are the amplitudes, which fill the square canvas equally in this version.
What do the controls do?
Frequency X and Frequency Y set how many oscillations each axis completes, the Phase δ slider shifts one wave relative to the other, and the colour menu restyles the trace. The preset buttons load known frequency-and-phase combinations, and Animate δ sweeps the phase to make the figure rotate and morph.
The ratio fx:fy determines the figure's overall form, including how many lobes or loops appear along each axis. A 1:1 ratio gives ellipses and lines, while ratios like 3:2 or 5:4 produce more intricate woven patterns. The simpler the ratio, the more open the shape.
The phase δ offsets the X oscillation in time relative to the Y oscillation. At δ = 0 a 1:1 figure collapses to a diagonal line; at δ = π/2 it opens into a circle or ellipse. For other ratios the phase rotates and reshapes the pattern, which is why animating δ makes the figure appear to spin.
The curve closes into a repeating loop when the frequency ratio is rational, that is, expressible as a ratio of whole numbers. Because this simulation restricts both frequencies to integers from 1 to 10, every figure shown is closed and periodic. Irrational ratios would never close and would gradually fill the area.
Yes, the mathematics is exact: the trace is the true combination of two sinusoids with the chosen frequencies and phase. The visualisation simplifies presentation by using equal amplitudes and sampling the path in 1500 steps, but the geometry of each curve faithfully matches the underlying equations.
The phase slider runs from 0 to 628 and is divided by 100 in the code, giving a phase δ from 0 to roughly 2π radians (about 6.28). The label snaps to friendly fractions such as π/4, π/2 and π when you land near them, and otherwise shows a decimal value.
Feeding two signals into an oscilloscope's X and Y inputs produces a Lissajous figure whose shape reveals their frequency ratio and phase relationship. Engineers use this to match frequencies, measure phase shifts, and check signal purity. A steady, simple figure indicates the two frequencies are locked in a small whole-number ratio.
Beyond electronics, Lissajous curves arise in coupled mechanical vibrations, laser-light displays, harmonographs and audio stereo metering. They also model the motion of a two-dimensional harmonic oscillator, making them a recurring example in physics courses on waves and oscillations.
Each preset loads a frequency pair and phase that produces a recognisable shape: Figure-8 uses a 1:2 ratio, Flower uses 3:2, Star uses 5:4 and Knot uses 3:5. They are convenient starting points that let you see how distinct ratios create very different families of curves.