// Exercice 1
//figure(0);
//clf;
// t = [0:0.01:2*%pi]; 
// x = cos(t).^3; y = sin(t).^3; plot2d(x,y);
//
//figure(1);
//clf;
// t = [0:0.01:2*%pi]; 
// x = 2.*cos(t)+cos(2.*t); 
//y = 2.*sin(t)+sin(2.*t);plot2d(x,y);
//
//
//
//figure(2);
//clf;
// t = [-100:0.01:100]; 
// x = t./(1+t.^4); 
//y = (t.^3)./(1+t.^4); 
//plot2d(x,y);


figure(3);
t = [0:0.01:2*%pi]; 
 x1 = -3.*(cos(t).^3).*sin(t); y1 = 2.*cos(t).^2; 
 x2 = 2.*sin(t);  y2 = sin(2.*t);
 x3 = -cos(t).^3;  y3 =  2.*(sin(t).^6)-2.;
  t = [-1:0.01:1]; 
  x4 =  t;  y4 =  t-t-2 ;
 plot2d(x1,y1);
 plot2d(x2,y2);
 plot2d(x3,y3);
 plot2d(x4,y4);

figure(4)

//// Exercice 2: courbes paramétrées animées
//t = linspace(0,10*%pi,500);
//clf();
//set(gca(),"isoview","on"); //set isoview axes
//comet(t.*sin(t), t.*cos(t))
//
//
//
//t = linspace(0,10*%pi,500)';
//clf();comet(t.*sin(t),[t.*sin(2*t) t.*sin(3*t)],"colors",[3 5])
// 
// 
// 
// t = linspace(-%pi,%pi,500)';
//function z=traj(x, y),z=1.5*sin(x^2)*cos(y),endfunction
//clf();comet3d(cos(t),sin(t),traj)
// 
//
//// Exercice 3: tapis de Sierpinski
//clf;
//A = [0,0]
//for i = 1:30000 do
//    A = pointsuivant(A)
//    x(i) = A(1)
//    y(i) = A(2)
//end
//plot2d(x,y,style=-1)
//
//
//
//
//  
//
