%Parametric Curve Demo
%Fred Park 2014

%ex1
t = [0:10*2*pi/1000:10*pi];
x= cos(t);
y=sin(t);
figure;
comet(x,y);
disp('Hit any key to continue')
pause

%ex2
t = [0:10*2*pi/1000:10*2*pi];
x= cos(t).^2;
y=cos(t);
figure;
comet(x,y);
disp('Hit any key to continue')
pause

%ex3
t = -pi:pi/200:pi;
figure;
comet(t,tan(sin(t))-sin(tan(t)))
disp('Hit any key to continue')
pause

%ex4
t = -5*pi:pi/50:5*pi;
x = cos(t);
y= sin(t);
z = t;
figure;
comet3(x,y,z);
disp('Hit any key to continue')
pause;

%ex5
figure;
t = -pi:pi/300:pi; 
axis([-1 1 -1 1 -1 2]) 
hold on 
for i=1:2:length(t)-1 
T=[t(i) t(i+1)]; 
plot3(sin(5*T),cos(3*T),T,'r-') 
pause(0.000001) 
end 
hold off
