create a lissajous curve in matlab

main.m
% Define the parameters for the Lissajous curve
A = 1; % Amplitude along x-axis
B = 1; % Amplitude along y-axis
a = 3; % Frequency along x-axis
b = 2; % Frequency along y-axis
delta = pi/2; % Phase difference

% Create a time vector
t = linspace(0, 2*pi, 1000);

% Calculate the x and y coordinates of the Lissajous curve
x = A * sin(a*t);
y = B * sin(b*t + delta);

% Plot the Lissajous curve
plot(x, y);
title('Lissajous Curve');
xlabel('X-axis');
ylabel('Y-axis');
468 chars
20 lines

gistlibby LogSnag