Did you already complete the Lissajous Plot, Part 1?
Remember that a Lissajous curve
corresponds to the superposition of two oscillations
(one along the x-axis and one along the y-axis)
that are described by two functions of a common parameter t:
x = fx(t) = ax * sin(wx * t + px)
y = fy(t) = ay * sin(wy * t)
The curve consists of all points (x, y) for all values of t.
If it worked, you should see a blue circle.
What do the five parameters of lissajous_plot mean?
wx and wy are the angular frequencies of the oscillations in the x and y directions.px is a phase shift applied to the x oscillation.ax and ay are the amplitudes of the oscillations in the x and y directions;
they determine the overall width and height of the resulting plot
(the plot will be at most 2 * ax wide and 2 * ay high).In Lissajous Plot, Part 1 we looked at examples where the horizontal and vertical oscillations had the same frequency (
wx == wy).
Now let's look at examples where those frequencies differ!
For the following discussion, assume we work with an unscaled curve (ax == 1 and ay == 1).
What happens if the frequency along one axis is twice the frequency along the other axis?
Yes, you get a parabola!
Let's pick the ratio wx / wy == 1 / 2, and let's look at the effect of varying the phase shift.
How does this look as an animation?
What about a ratio of wx / wy = 3 / 1?
Well, if we invert the ratio, this simply swaps the axes.
Let's try with a ratio of wx / wy = 4 / 5 and wx / wy = 5 / 4.
You could describe the curves of having a certain number of horizontal and vertical "lobes". Count the number of peaks along the edges. The 4:5 curve has 5 peaks along the top edge, and 4 peaks along the left edge. The peak counts are swapped for the 5:4 curve.
Note: Depending on the ratio, you might have to change px as well to get a rotation that best shows off the lobes.
For example, a ratio of wx / wy == 5 / 3 is tricky at px == 0:
Let's animate this to convince ourselves that there indeed are 5 lobes on the left edge and 3 lobes on the top edge.
The most powerful parametric plot function we have in the plot library is parametric_color_thickness_plot.
Like the parametric_plot function used by lissajous_plot, this also expects the two functions
(fx(t) and fy(t)) and a range of values for t on which to plot dots.
However, additionally, you also can provide a function to determine the dot color and the dot size.
Let's use that function to build a lissajous_color_thickness_plot function!
Ok, this looks neat, but let's animate this by shifting the phase.
This activity has been created by LuCE Research Lab and is licensed under CC BY-SA 4.0.
Lissajous Plot, Part 2

PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI
Privacy Policy • Platform Version c30aa49 (Tue, 25 Nov 2025 16:55:08 GMT)