What happens when you combine two independent, perpendicular vibrations?
Consider a point whose horizontal and vertical positions each oscillate with simple harmonic motion:
$$x(t) = A \sin(a \cdot t + \delta)$$
$$y(t) = B \sin(b \cdot t)$$
where $a$ and $b$ are the frequencies of oscillation, and $\delta$ is the phase shift between them.
These mesmerizing paths are called Lissajous Curves (or Bowditch curves). In 1857, French physicist Jules Antoine Lissajous bounced beams of light between tiny mirrors attached to vibrating tuning forks, projecting these figures onto walls to study sound harmonics!
Lissajous curves are fundamental in physics, electronics, and acoustics:
Frequency Ratio ($a : b$): The shape reveals the exact ratio of the two frequencies. Counting the number of horizontal peaks gives frequency $b$, and counting vertical peaks gives frequency $a$!
Phase Difference ($\delta$): As the phase shift $\delta$ sweeps from $0$ to $2\pi$, the 2D curve appears to rotate smoothly in space like a 3D translucent cylinder or wireframe knot!
Oscilloscopes: Electrical engineers display one signal on the X-channel and another on the Y-channel to instantly test whether two AC waveforms are in sync.
In this lesson, we use gif_axes(color), gif_line(x1, y1, x2, y2, color), and gif_fillcircle(x, y, r, color) to animate a 3:2 frequency harmonic as its phase angle rotates through a full $360^\circ$ cycle!
gif_axes(color)
Move the mouse over a dotted box for more information.
Now you try. Try setting a = 5 and b = 4, or try a = 1 and b = 2 to make a figure-eight!
Type your code here:
See your results here:
The code has ???? for frequencies a and b. Replace with a = 3 and b = 2, then click Run to generate the animated Lissajous figure!
Notes:
gif_axes(color) is a built-in helper that draws the $(X, Y)$ coordinate axes passing through the origin $(0, 0)$.
When $a = 1$ and $b = 1$, the figure is an ellipse that flattens into a line when $\delta = 0$ and opens into a circle when $\delta = \pi / 2$.
When $a$ and $b$ are integers, the curve is a closed periodic orbit that repeats forever.
Share your code
Show a friend, family member, or teacher what you've done!