Did you already complete the Parametric Plot activity?
If not, complete it before moving on.
A Lissajous curve can be 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 (fx(t), fy(t)) for all values of t.
It corresponds to the superposition of two oscillations: one along the x-axis and one along the y-axis.
There are five undefined names in these functions:
wx, wy, and px determine the shape of a specific Lissajous curve,
and ax and ay determine its scale.
The following lissajous_plot function calls parametric_plot passing it the above two functions fx and fy.
What? No way!!!
You probably recognize this graphic. Funny, how little information (just 5 numbers) is needed to produce the logo of a company that collects so much information.
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).Let's look at some more examples to get an intuition. For the following discussion, assume we work with an unscaled curve (ax == 1 and ay == 1).
Let's assume that the two oscillations (in the x and y direction) have the same frequency, wx == wy.
When discussing Lissajous curves, the relationship between wx and wy is often described as a ratio: wx / wy.
Here, that ratio wx / wy == 1.
Given that wx and wy are the same, let's just use w to denote that frequency.
If the phases are the same (px == 0), we get the following parametric curve:
x = fx(t) = sin(w * t)
y = fy(t) = sin(w * t)
This means that for all possible t, x == y.
Let's shift the phase of the x oscillation by 90 degrees (px == pi / 2).
We get the following parametric curve:
x = fx(t) = sin(w * t)
y = fy(t) = sin(w * t + pi/2)
It's a circle! This is equivalent to when you created a circle by directly calling parametric_plot
in the Parametric Plot activity.
Why? You used cos(p) in the other activity but sin(p + pi / 2) here.
And cos(t) = sin(t + pi / 2).
Ok, we get something between a line and a circle: an ellipse!
This looks like we could morph from a line to a circle, going through an ellipse, if we shift the phase gradually from 0 to 90 degrees.
Let's try!
Manually entering different phase shifts and rerunning the code each time is annoying!
Let's build a table, with 9 curves, each with a different phase shift. The leftmost curve should have a phase shift of 0 degrees, the midlle curve one of 90 degrees (circle), and the rightmost curve one of 180 degrees.
What happens, if we shift the phase beyond 180 degrees? Let's go all the way from 0 to 360!
If we gradually vary px from 0 to 360 degrees, we should get a nice animation.
Let's try!
This looks like we are morphing a line into a circle and back. Or, if you squint your eyes a bit, it looks like a hula hoop spinning on the floor!
You can adjust the step size in the call to float_range.
If you make it smaller, the animation will appear slower and smoother.
You completed your exploration of the Lissajous curves with a ratio of wx / wy = 1.
In a next part, you will explore what happens with different ratios.
This activity has been created by LuCE Research Lab and is licensed under CC BY-SA 4.0.
Lissajous Plot, Part 1

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)