Lissajous Figures

Author: Cass Lewart (rlewart@monmouth.com)

Program Description

The program displays pictures similar to those seen on an oscilloscope, 
where the X-axis and Y-axis inputs are harmonically related sinusoidal 
voltages with frequencies na and nb. The program plots a parametric 
function of an independent variable t starting with t=0 and ending with 
t=tmax.

The variable t is incremented by the amount delta every time the program 
goes through a loop. A line is then drawn between the last computed X and Y 
values and the newly computed values. If the ratio of the two input 
frequencies na and nb is a rational number, then the Lissajous figure will 
close, i.e., the plot will repeat. The number of cycles is determined by 
the lowest common denominator of na and nb. lf the denominator is large the 
plot will fill the whole screen. 

Program Instructions

Follow the prompts  for relative horizontal and vertical frequencies -  
input to your imaginary oscilloscope, also for the increment of the 
parameter t, and tmax, the maximum value of t. For a given set of 
frequencies you can experiment with different values of the increment. A 
smaller value will give a smoother display but it will take more time to 
complete. Similarly, the value of tmax controls the number of cycles drawn 
on the display.

Example

Display a Lissajous figure for harmonically related frequencies of 4.0 and 
5.0 with increment of 0.1 and tmax of 7.




