%
disp(' Lissajous.m  ver 1.0   August 28, 2006 ')
disp(' ')
disp(' by Tom Irvine    Email: tomirvine@aol.com ')
%
%
disp(' ')
a=input(' Enter x-axis amplitude ');
disp(' ')
b=input(' Enter y-axis amplitude ');
disp(' ')
f1=input(' Enter x-axis frequency Hz ');
disp(' ')
f2=input(' Enter y-axis frequency Hz ');
disp(' ')
phase1=input(' Enter x-axis phase (deg) ');
disp(' ')
phase2=input(' Enter y-axis phase (deg) ');
%
phase1=phase1*pi/180;
phase2=phase2*pi/180;
%
omega1=2.*pi*f1;
omega2=2.*pi*f2;
%
period1=1/f1;
period2=1/f2;
%
p(1)=period1;
p(2)=period2;
%
dt=min(p)/100;
%
N=30*(max(p)/dt);
%
TT=linspace(0,N*dt,(N+1)); 
x=a*sin(omega1*TT+phase1);
y=b*sin(omega2*TT+phase2);
%
plot(x,y);
axis([(-a*1.1),(a*1.1),(-b*1.1),(b*1.1)]);
%
ylabel('y');
xlabel('x');
%
pp='\pi';
%
ph1=phase1*180/pi;
ph2=phase2*180/pi;
%
out5 = sprintf(' x=%g sin( 2%s %g t + %g)    y=%g sin( 2%s %g t + %g)',a,pp,f1,ph1,b,pp,f2,ph2);
title(out5);
%
