Lissajous Plot, Part 2

Did you already complete the PyTamaro iconLissajous 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.

Loading...

If it worked, you should see a blue circle.

The Five Parameters

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 PyTamaro iconLissajous 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).

Half/Double the Frequency

What happens if the frequency along one axis is twice the frequency along the other axis?

Loading...

Yes, you get a parabola!

Loading...

Let's Tabulate!

Let's pick the ratio wx / wy == 1 / 2, and let's look at the effect of varying the phase shift.

Loading...

Let's Animate!

How does this look as an animation?

Loading...

Third/Triple the Frequency

Loading...

Let's Tabulate!

Loading...

What about a ratio of wx / wy = 3 / 1?

Loading...

Well, if we invert the ratio, this simply swaps the axes.

4/5 and 5/4

Let's try with a ratio of wx / wy = 4 / 5 and wx / wy = 5 / 4.

Loading...

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.

Loading...

For example, a ratio of wx / wy == 5 / 3 is tricky at px == 0:

Loading...

Let's animate this to convince ourselves that there indeed are 5 lobes on the left edge and 3 lobes on the top edge.

Loading...

Let's get Colorful!

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!

Loading...

Let's Animate!

Ok, this looks neat, but let's animate this by shifting the phase.

Loading...

This activity has been created by LuCE Research Lab and is licensed under CC BY-SA 4.0.

Lissajous Plot, Part 2

Logo of PyTamaro

PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI

Privacy PolicyPlatform Version c30aa49 (Tue, 25 Nov 2025 16:55:08 GMT)