# Lissajous

Name: Lissajous (plug-in) or lissajous (JWildfire version)
Type: 2D shape
Author: Jed Kelsey (Lu-Kout)

## Overview

Lissajous is a 2D shape variation that generates Lissajous curves, named after French physicist Jules Antoine Lissajous. They are familiar to most people as the figures displayed on the consoles of “high-tech” equipment in science fiction movies and television shows in the 1960s and 1970s. Here are some examples:

Lissajous curves show the interaction of two perpendicular sine waves, one on the x-axis and one on the y-axis. Depending on the relative frequencies and phases, different shapes can be obtained.

## Parameters

 variation amount Sets the overall size of the figure; 1 is a typical value. a, b The frequency of the x and y components; the shape of the curve is determined by their ratio. They are normally integers; this is not required, but it makes working with the variation easier. c The amount of diagonal movement. Set to 0 (the default) for a standard Lissajous curve. Set to a very small amount (like between 0.001 and 0.01) and increase the range of tmin and tmax to repeat the curve along the top-left to bottom-right diagonal. d The phase difference between the x and y frequencies, in radians. Useful values are between -π and π (other values are allowed, but don’t produce anything different). The most common values are 0 and π/2 (1.5708). e The thickness of the line used to draw the curve. Keep it small for best results.

## Details

Lissajous curves consist of a number of “lobes”. If a and b have no common factors, then a will be the number of vertical lobes and b the number of horizontal lobes. Except that if a and b are both odd, the corresponding sine waves will be “in-phase” and the curve will retrace itself, producing points at the ends and only half the lobes. Set d to 1.5708 to adjust the phase and see the fully-lobed curve. Here are four examples: the first two have a odd and b even and the last two have a and b both odd. Each is shown with both d=0 and d=1.5708.

Of course, d can have other values as well; they produce intermediate results. The Lissajous curves you see on consoles in old sci-fi movies are often moving, which is a more interesting effect than a fixed figure. With electronics, this is done by slightly changing one of the frequencies; with flame fractals, this must be done with animation. Although the animation could be made by slightly changing a or b (for example, a=4 and b=3.01) and animating the tmin and tmax values, it is easier and smoother to keep a and b as integers and animate d.

The variation also has the ability to repeat the curve along a diagonal line, using the c parameter. For best results, it should be very small, a few thousandths. Since the default values of tmin and tmax only draw one iteration, they must be adjusted as well. For example, since values of -π and π draw one iteration, use values of -3π and 3π to draw three iterations. In the following examples, a=2, b=3, and d=0, with various values of c, tmin, and tmax:

## Special Considerations

As a shape variation, the input point and any pre-affine transforms are ignored. Use a post-affine transform to move, rotate, or resize the resulting figure.

## Mathematics

Lissajous uses the following parametric equations (t is the parameter, set to a random value between tmin and tmax):

$x=sin(at+d)+ct$
$y=sin(bt)+ct$

Note that d, the phase parameter, is only used in the x equation. Only the phase difference matters for the shape, so a separate phase parameter for y is not needed.

## Related Variations

spirograph, spirograph3D