input newcourbes;
input couleur;
input geometriesyr16;
input TEX;
%input tableauVariation;


verbatimtex
%&latex
\documentclass{article}
\usepackage[upright]{fourier}
\usepackage{preambule}
\begin{document}
etex


%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% réciproque
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


beginfig(1)

vardef fx(expr t)= t enddef;
vardef fy(expr t)= exp(t-1)-t enddef;

repere(0,0,-1,4,-3,4,2cm,2cm);
r_axes;
r_origine;
r_unites;
r_labelxy;

path g,h;
g:= f_courbe(fx,fy,1,4,100);
draw g withcolor red;
%h:= f_courbe(fy,fx,-3,4,100);
%draw h withcolor blue;
draw g reflectedabout ((0,0),r_p(3,3)) withcolor blue;

draw r_droite(0,0,1) dashed evenly;

pair n;
n:=r_p(2,fy(2));
label.lrt(btex $y=f(x)=\E^{x-1}-x$ etex,n ) withcolor red;
label.lrt(btex $y=f^{-1}(x)$ etex,n reflectedabout ((0,0),r_p(3,3)) ) withcolor blue;
label.lrt(btex $y=x$ etex, r_p(-2,-2));
r_fin;
endfig;





%%%%%
% approximation discrète d'une edo
%%%%%%%%%%%%%%%%%%%%%%%%





beginfig(2)

repere(0,0,-1,10,-1,5,1cm,1cm);
r_axenom(btex $t$ etex,btex $u$ etex);
r_origine;


vardef fx(expr t)=t   enddef;
vardef fy(expr t)=sqrt(t+1)   enddef;

draw f_courbe(fx,fy,0,8,100) withpen pencircle scaled 1.3bp withcolor .6white;

numeric v;
pair uz, uu, ud, ut,Uu,Ud,Ut,Uq,tu,td,tt;
uz:=r_p(0,fy(0));r_pp(0,fy(0));
uu:=r_p(2,fy(2));tu:=r_p(2,0);
ud:=r_p(4,fy(4));td:=r_p(4,0);
ut:=r_p(6,fy(6));tt:=r_p(6,0);
v:=1;
Uu:=r_p(2,fy(2)+.7v);r_pp(2,fy(2)+.7v);
Ud:=r_p(4,fy(4)+v);r_pp(4,fy(4)+v);
Ut:=r_p(6,fy(6)+v);r_pp(6,fy(6)+v);
Uq:=r_p(8,fy(8)+.9v);r_pp(7.5,fy(7.5)+.9v);

draw Uu--tu dashed evenly;
draw Ud--td dashed evenly;
draw Ut--tt dashed evenly;

r_cp(2,fy(2));r_cp(4,fy(4));r_cp(6,fy(6));

draw uz--Uu--Ud--Ut--Uq;
draw (Uu shifted r_p(.1v,.3v))--(Ud shifted r_p(-0.2v,.18v)) dashed withdots withpen pencircle scaled 2bp;
draw (tu shifted r_p(0.1v,-.3v))--(td shifted r_p(-0.1v,-.3v)) dashed withdots withpen pencircle scaled 2bp;




drawdblarrow (td shifted r_p(0,-v))--(tt shifted r_p(0,-v));


label.lrt(btex $u(t_n)$ etex, ud);
label.lrt(btex $u(t_{n+1})$ etex, ut);
label.top(btex $u_n$ etex, Ud);
label.top(btex $u_{n+1}$ etex, Ut);
label.ulft(btex $u_1$ etex, Uu);
label.lft(btex $u_0$ etex, uz);
label.lrt(btex $t_n$ etex, td);
label.llft(btex $t_1$ etex, tu);
label.bot(btex $t_{n+1}$ etex, tt);
label.top(btex $h$ etex, .5(td+tt) shifted r_p(0,-v));
label.top(btex {\small Solution numérique} etex, Uq);
label.top(btex \textcolor{0.6white}{\small Solution exacte} etex, r_p(8,fy(8)));



r_fin;

endfig;


















%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%
%
%
%        M E T H O D E        D e S       T R A P E Z E S 
%%
%
%
% Trapèze
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Déclarations des constantes %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  numeric xmin, xmax, ymin, ymax, N;

  ux:=1cm;  uy:=1cm;
  xmin := -.5 ; xmax := 8;
  ymin := -.5; ymax := 4;


  pair d,h;
  d:=(.1*ux,0);
  h:=(0,.1*uy);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Définitions des axes et labels associés
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  vardef axes =
   drawarrow (ux*xmin,0) -- (ux*xmax,0) ; % axe des x
   drawarrow (0,uy*ymin) -- (0,uy*ymax); % axe des y
   label.rt(btex $t$ etex,(xmax*ux,0)); % label de l'axe des x
   label.urt(btex $u$ etex,(0,ymax*uy)); % label de l'axe des y
  enddef;

 beginfig(3);

path t; % tirets
t:=((0,0)shifted h)--((0,0)shifted -h);

pair A,B,C,a,b; A:=(ux,1.5*uy); C:=(2.5*ux,2.5*uy); B:=(7*ux,uy); a:=A yscaled 0; b:=B yscaled 0;

pair M,N,m,n; path P,Q,QQ,R,S;

P:=A{dir-10}..C..{dir-10}B;

M:=point .7 of P; N:=point 1.2 of P; m:=M yscaled 0; n:=N yscaled 0;

S:=subpath(.7,1.2) of P; 
QQ:=M--N;
Q:=N--n--m--M--cycle; 
R:=buildcycle(S,QQ);

fill R withcolor bleu_f;%(0.829997,0.099994,0.119999);

fill Q withcolor bleu;% (0.529405,0.807794,0.921598);

axes; draw P; draw (A--a) dashed evenly; draw (B--b) dashed evenly; draw (M--m) dashed evenly; draw (N--n) dashed evenly;

draw t shifted a; draw t shifted b; draw t shifted m; draw t shifted n;

%label.bot(btex $a$ etex,a shifted -1.9h); label.bot(btex $b$ etex,b shifted -h); 
label.bot(btex $kh$ etex,m shifted -1.9h-d);
label.bot(btex $(k+1)h$ etex,n shifted -h+4d);

pair T; T:=M xscaled 0; draw (T--M) dashed evenly;
pair TT; TT:=N xscaled 0; draw (TT--N) dashed evenly;


path U,V; pair t; U:=N--n; V:=T--(T shifted (6*ux,0)); t:=U intersectionpoint V;
%draw (M--t);

draw (T shifted d)--(T shifted -d); label.lft(btex $u(kh)=u_k$ etex,T shifted -d);
draw (TT shifted d)--(TT shifted -d); label.lft(btex $u((k+1)h)=u_{k+1}$ etex,TT shifted -d);


%label.rt(btex $\mathcal{A}(x,x\!+\!dx)$ etex,(3.4*ux,1.5*uy)); drawarrow (3.4*ux,1.5*uy)--(2.3*ux,1.5*uy);

endfig;














%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%
%      Méthode de Newton
%
%









beginfig( 4)


%%%%%%%%%%%%%%%%%%%%%%%
vardef fx(expr t)=
t
enddef;

vardef fy(expr t)=
                          (t-1)**2    % c'est la seule ligne à changer
enddef;
%%%%%%%%%%%%%%%%%%%%%
repere(0,0,-.5,4,-2,5,3cm,1cm);
r_axes;
%r_origine;
%r_unites;
%r_labelxy;
%quad_xy(0.2,bleu_ciel);
%quadu_xy(0.1*bleu_ciel);
%grad_x(1,1,0.4white);
%grad_y(1,1,0.4white);

draw f_courbe(fx,fy,-.5,4,100)withpen pencircle scaled 1.5bp withcolor blue;
draw f_tangente(fx,fy,2,0.05);

dotlabel.top( btex  etex, r_p(2,1) );
dotlabel.top( btex  etex, r_p(2,0) );
dotlabel.top( btex  etex, r_p(1.5,0) );
dotlabel.top( btex  etex, r_p(1,0) );
draw r_segment(2,1,2,0) dashed evenly;

drawarrow r_p(1.5,-1.5)--r_p(1.5,-0.2) withcolor .7white;

drawarrow r_p(2,-1)--r_p(2,-0.1) withcolor .7white;

drawarrow r_p(.5,1)--r_p(1,0.1) withcolor .7white;

label.bot(btex $x_1$ etex,r_p(1.5,-1.5) )withcolor .7white;
label.bot(btex $x_0$ etex,r_p(2,-1) )withcolor .7white;
label.top(btex Le zéro cherché  etex,r_p(.5,1) )withcolor .7white;
r_fin;
endfig;








%%%%%%%%%%%%%%%%%%%%%%
%
%
% Lecture graphique 2nde
%
%



beginfig( 5)


%%%%%%%%%%%%%%%%%%%%%%%
vardef fx(expr t)=
t
enddef;

vardef fy(expr t)=
           4/(t+1)-3                   % c'est la seule ligne à changer
enddef;
%%%%%%%%%%%%%%%%%%%%%
repere(0,0,-9,9,-8,4,1cm,1cm);

fillcolor:=1.1*ciel;
path p;
p:=r_p(-11,-1)--r_p(11,-1)--r_p(11,5)--r_p(-11,5)--cycle;

transparence p;


r_axes;
r_origine;
r_unites;
r_labelxy;
%quad_xy(0.2,0.7white);
%quadu_xy(0.3white);
grad_x(1,1,0.4white);
grad_y(1,1,0.4white);




draw f_courbe(fx,fy,-0.5,10,100)withpen pencircle scaled 1.5bp withcolor red;
draw f_courbe(fx,fy,-10,-1.5,100)withpen pencircle scaled 1.5bp withcolor red;
draw rx_droite(-1) dashed evenly withcolor 0.2white withpen pencircle scaled 1.5bp ;
draw r_droite(-3,-3,0) dashed evenly withcolor 0.2white withpen pencircle scaled 1.5bp ;
draw r_droite(0,-2,1)  withcolor orange withpen pencircle scaled 1.5bp ;
draw r_droite(0,-1,0)  withcolor blue withpen pencircle scaled 1.5bp ;
label.bot(btex $\HR$ etex, r_p(-8,fy(-8)) ) withcolor red;
label.bot(btex $\Delta$ etex, r_p(5,3) ) withcolor orange;
label.bot(btex $I_1$ etex, r_p(1,fy(1)) ) withcolor red;
label.bot(btex $I_2$ etex, r_p(-3,fy(-3)) ) withcolor red;

r_fin;
endfig;










%%%%%%%%%%%%%%%
%
%
%   Géométrie analytique
%
%








   
beginfig( 6)


repere(0,0,-7,7,-5,4,1cm,1cm);
r_axes;
%r_origine;
%r_unites;
r_labelxy;
%quad_xy(0.2,bleu_ciel);
quadu_xy(0.2white);
%grad_x(1,1,0.4white);
%grad_y(1,1,0.4white);

dotlabel.top(btex A etex, r_p(2,2) );
dotlabel.ulft(btex B etex, r_p(-4,-1) );
dotlabel.bot(btex C etex, r_p(-3,-3) );
dotlabel.urt(btex E etex, r_p(3,0) );
dotlabel.lrt(btex I etex, r_p(-.5,-.5) );
dotlabel.ulft(btex K etex, r_p(-.5,.75) );
label.llft(btex $\Delta$ etex,r_p(4,-2) ) withcolor blue;

draw r_droite(2,2,0.5) withcolor orange withpen pencircle scaled 1.5bp;

draw r_droite(0,6,-2)withcolor blue withpen pencircle scaled 1.5bp;

draw r_seg(-3,-3,-4,-1)withpen pencircle scaled 1.1bp withcolor 0.5white;
draw r_seg(-3,-3,2,2)withpen pencircle scaled 1.1bp withcolor 0.5white;
draw r_seg(-3,-3,3,0)withpen pencircle scaled 1.1bp withcolor 0.5white;

draw rx_droite(-.5) withcolor red withpen pencircle scaled 1.5bp;

draw codesegments(r_p(2,2),r_p(-.5,-.5),r_p(-.5,-.5),r_p(-3,-3),2)withpen pencircle scaled 1.1bp withcolor 0.5white ;

draw codeperp(r_p(-3,-3),r_p(-4,-1),r_p(2,2),8)withpen pencircle scaled 1.1bp withcolor 0.5white;

r_fin;
endfig;




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% D I v           E U C               37 / 4





beginfig(7)
numeric u;
u:=1cm;
drawarrow (0,0)--(11u,0);
numeric h;
h:=0.2; path t;
t:= (u,-h*u)--(u,h*u);
draw t  withpen pencircle scaled 1.2bp;
draw t shifted (3u,0)withpen pencircle scaled 1.2bp;% withpen pencircle scaled 1.2bp;
draw t shifted (6u,0) withpen pencircle scaled 1.2bp;
draw (6u,-h*u)--(6u,2*h*u)withpen pencircle scaled 1.6bp withcolor 0.6white;
%draw t shifted (7.5u,0);

label.bot(btex $8\times 4$ etex, (u,-h*u)) withcolor bleu_f;
label.bot(btex $9\times 4$ etex, (4u,-h*u)) withcolor bleu_f;
label.bot(btex $10 \times 4$ etex, (7u,-h*u)) withcolor bleu_f;
label.top(btex $\Mathbold{37}$ etex, (6u,2*h*u)) withcolor 0.6white ;
%label.bot(btex $A_4$ etex, (8.5u,-h*u)) withcolor bleu_f;


drawdblarrow(4u,1.5*h*u)--(6u,1.5*h*u);
label.top(btex reste etex, (5u,1.5*h*u));

%drawdblarrow(5u,h*u)--(7u,h*u);
%label.top(btex $10$ etex, (6u,h*u));

%drawdblarrow(7u,h*u)--(8u,h*u);
%label.top(btex $1$ etex, (7.5u,h*u));

drawdblarrow(4u,1.2u)--(7u,1.2u) withcolor bleu_f;
label.top(btex $4$ etex, (5.5u,1.2*u)) withcolor bleu_f;

label.top(btex \Huge{\Flag} etex, (1.17u,0)) withcolor bleu_f;
label.top(btex \Huge{\Flag} etex, (4.17u,0)) withcolor bleu_f;
label.top(btex \Huge{\Flag} etex, (7.165u,0)) withcolor bleu_f;







endfig;






%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% S P I R A L E

beginfig(8)

numeric u;
u:=1cm;

pair a[],o,s;

s:=(1,-1);
o:=origin;
a[0]:=(0,-u);
for i=0 upto 5 :
a[i+1]:=a[i] zscaled s;
endfor

draw o--a[0] dashed evenly;
for i=1 upto 6 :
draw o--a[i] dashed evenly;

draw a[i-1]--a[i] withcolor 0.6white withpen pencircle scaled 2bp;

draw symbole_ortho(o,a[i-1],a[i],0.25u);

draw_marks(o--a[i-1],i);
draw_marks(a[i-1]--a[i],i);

endfor

endfig;



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% aXE

beginfig(9)



repere(0,0,-5,7,-1,1,1cm,1cm);

%r_axes;

drawarrow r_p(-6.5,0)..r_p(6.5,0) ;
grad_x(1,1,red);
label.bot(btex 0 etex,r_p(0,-.2));
draw r_p(0,0.2)..r_p(0,-0.2);

%r_fin;

endfig;





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
%%                                                    I N T E R V A L L E S                 %
%%
%%%%%%

repere(0,0,-5,7,-1,1,.7cm,1cm);

pair A,B,C,D;
A:=r_p(-6.5,0); B:=r_p(2,0);  C:=r_p(-1,0); D:=r_p(5,0);




path d,g;

d:=(1mm,1.5mm)--(0,1.5mm)--(0,-1.5mm)--(1mm,-1.5mm);
g:=(-1mm,1.5mm)--(0,1.5mm)--(0,-1.5mm)--(-1mm,-1.5mm);




beginfig(10);
%r_axes;

drawarrow r_p(-6.5,0)..r_p(6.5,0) ;
grad_x(1,1,.5white);
label.bot(btex 0 etex,r_p(0,-.2));
draw r_p(0,0.2)..r_p(0,-0.2);

pickup pencircle scaled 2bp;

 label.top(btex $I=]-\infty\pv 2]$ etex, r_p(-3,1) ) withcolor white;
%draw  A--B withcolor red; draw g shifted B withcolor red;  label.top(btex $I=]-\infty\pv 2]$ etex, r_p(-3,1) ) withcolor red;

%draw C--D withcolor blue; draw g shifted C withcolor blue; draw d shifted D withcolor blue;label.top(btex $J=]-1\pv 5[$ etex, %r_p(3,1) ) withcolor blue;

%draw C--B withcolor green; draw g shifted C withcolor green; draw g shifted B withcolor green;label.top(btex $I\cap J=]-1\pv %2]$ etex, r_p(1,1) ) withcolor green;


%draw A--D withcolor bleu; draw d shifted D withcolor bleu; label.top(btex $I\cup J=]-\infty\pv 5[$ etex, r_p(0,1) ) withcolor %bleu;




%r_fin;

endfig;





beginfig(11)

path d,g;

d:=(1mm,1.5mm)--(0,1.5mm)--(0,-1.5mm)--(1mm,-1.5mm);
g:=(-1mm,1.5mm)--(0,1.5mm)--(0,-1.5mm)--(-1mm,-1.5mm);

%r_axes;

drawarrow r_p(-6.5,0)..r_p(6.5,0) ;
grad_x(1,1,.5white);
label.bot(btex 0 etex,r_p(0,-.2));
draw r_p(0,0.2)..r_p(0,-0.2);

pickup pencircle scaled 2bp;


draw  A--B withcolor red; draw g shifted B withcolor red;  label.top(btex $I=]-\infty\pv 2]$ etex, r_p(-3,1) ) withcolor red;

%draw C--D withcolor blue; draw g shifted C withcolor blue; draw d shifted D withcolor blue;label.top(btex $J=]-1\pv 5[$ etex, %r_p(3,1) ) withcolor blue;

%draw C--B withcolor green; draw g shifted C withcolor green; draw g shifted B withcolor green;label.top(btex $I\cap J=]-1\pv %2]$ etex, r_p(1,1) ) withcolor green;


%draw A--D withcolor bleu; draw d shifted D withcolor bleu; label.top(btex $I\cup J=]-\infty\pv 5[$ etex, r_p(0,1) ) withcolor %bleu;




%r_fin;

endfig;












beginfig(12)

path d,g;

d:=(1mm,1.5mm)--(0,1.5mm)--(0,-1.5mm)--(1mm,-1.5mm);
g:=(-1mm,1.5mm)--(0,1.5mm)--(0,-1.5mm)--(-1mm,-1.5mm);

%r_axes;

drawarrow r_p(-6.5,0)..r_p(6.5,0) ;
grad_x(1,1,.5white);
label.bot(btex 0 etex,r_p(0,-.2));
draw r_p(0,0.2)..r_p(0,-0.2);




%pickup pencircle scaled 2bp;

draw  A--B withcolor red withpen pencircle scaled 2bp ; draw g shifted B withcolor red  withpen pencircle scaled 2bp ;  label.top(btex $I=]-\infty\pv 2]$ etex, r_p(-3,1) ) withcolor red withpen pencircle scaled 2bp;


draw C--B withcolor blue;
pickup pencircle scaled 2bp;

draw B--D withcolor blue; draw g shifted C withcolor blue; draw d shifted D withcolor blue;label.top(btex $J=]-1\pv 5[$ etex, r_p(3,1) ) withcolor blue;

%draw C--B withcolor green; draw g shifted C withcolor green; draw g shifted B withcolor green;label.top(btex $I\cap J=]-1\pv %2]$ etex, r_p(1,1) ) withcolor green;


%draw A--D withcolor bleu; draw d shifted D withcolor bleu; label.top(btex $I\cup J=]-\infty\pv 5[$ etex, r_p(0,1) ) withcolor %bleu;




%r_fin;

endfig;










beginfig(13)

path d,g;

d:=(1mm,1.5mm)--(0,1.5mm)--(0,-1.5mm)--(1mm,-1.5mm);
g:=(-1mm,1.5mm)--(0,1.5mm)--(0,-1.5mm)--(-1mm,-1.5mm);

%r_axes;

drawarrow r_p(-6.5,0)..r_p(6.5,0) ;
grad_x(1,1,.5white);
label.bot(btex 0 etex,r_p(0,-.2));
draw r_p(0,0.2)..r_p(0,-0.2);

pickup pencircle scaled 2bp;


%draw  A--B withcolor red; draw g shifted B withcolor red;  
%label.top(btex $I=]-\infty\pv 2]$ etex, r_p(-3,1) ) withcolor red;

%draw C--D withcolor blue; draw g shifted C withcolor blue; draw d shifted D withcolor blue;
%label.top(btex $J=]-1\pv 5[$ etex, r_p(3,1) ) withcolor blue;

draw C--B withcolor green; draw g shifted C withcolor green; draw g shifted B withcolor green;label.top(btex $I\cap J=]-1\pv 2]$ etex, r_p(1,1) ) withcolor green;


%draw A--D withcolor bleu; draw d shifted D withcolor bleu; label.top(btex $I\cup J=]-\infty\pv 5[$ etex, r_p(0,1) ) withcolor %bleu;




%r_fin;

endfig;











beginfig(14)

path d,g;

d:=(1mm,1.5mm)--(0,1.5mm)--(0,-1.5mm)--(1mm,-1.5mm);
g:=(-1mm,1.5mm)--(0,1.5mm)--(0,-1.5mm)--(-1mm,-1.5mm);

%r_axes;

drawarrow r_p(-6.5,0)..r_p(6.5,0) ;
grad_x(1,1,.5white);
label.bot(btex 0 etex,r_p(0,-.2));
draw r_p(0,0.2)..r_p(0,-0.2);




%pickup pencircle scaled 2bp;

draw  A--B withcolor red withpen pencircle scaled 2bp; draw g shifted B withcolor red withpen pencircle scaled 2bp;  label.top(btex $I=]-\infty\pv 2]$ etex, r_p(-3,1) ) withcolor red withpen pencircle scaled 2bp;


draw C--B withcolor blue;
pickup pencircle scaled 2bp;

draw B--D withcolor blue; draw g shifted C withcolor blue; draw d shifted D withcolor blue;label.top(btex $J=]-1\pv 5[$ etex, r_p(3,1) ) withcolor blue;

%draw C--B withcolor green; draw g shifted C withcolor green; draw g shifted B withcolor green;label.top(btex $I\cap J=]-1\pv %2]$ etex, r_p(1,1) ) withcolor green;


%draw A--D withcolor bleu; draw d shifted D withcolor bleu; label.top(btex $I\cup J=]-\infty\pv 5[$ etex, r_p(0,1) ) withcolor %bleu;




%r_fin;

endfig;














beginfig(15)

path d,g;

d:=(1mm,1.5mm)--(0,1.5mm)--(0,-1.5mm)--(1mm,-1.5mm);
g:=(-1mm,1.5mm)--(0,1.5mm)--(0,-1.5mm)--(-1mm,-1.5mm);



%r_axes;

drawarrow r_p(-6.5,0)..r_p(6.5,0) ;
grad_x(1,1,.5white);
label.bot(btex 0 etex,r_p(0,-.2));
draw r_p(0,0.2)..r_p(0,-0.2);

pickup pencircle scaled 2bp;


%draw  A--B withcolor red; draw g shifted B withcolor red;  
%label.top(btex $I=]-\infty\pv 2]$ etex, r_p(-3,1) ) withcolor red;

%draw C--D withcolor blue; draw g shifted C withcolor blue; draw d shifted D withcolor blue;
%label.top(btex $J=]-1\pv 5[$ etex, r_p(3,1) ) withcolor blue;

%draw C--B withcolor green; draw g shifted C withcolor green; draw g shifted B withcolor green;label.top(btex $I\cap J=]-1\pv %2]$ etex, r_p(1,1) ) withcolor green;


draw A--D withcolor bleu; draw d shifted D withcolor bleu; label.top(btex $I\cup J=]-\infty\pv 5[$ etex, r_p(0,1) ) withcolor bleu;




%r_fin;

endfig;










beginfig(16)


pair A,B,C,D;
A:=r_p(-3,0); B:=r_p(3,0);  C:=r_p(-6.5,0); D:=r_p(1,0);





path d,g;

d:=(1mm,1.5mm)--(0,1.5mm)--(0,-1.5mm)--(1mm,-1.5mm);
g:=(-1mm,1.5mm)--(0,1.5mm)--(0,-1.5mm)--(-1mm,-1.5mm);



%r_axes;

drawarrow r_p(-6.5,0)..r_p(6.5,0) ;
grad_x(1,1,.5white);
label.bot(btex 0 etex,r_p(0,-.2));
draw r_p(0,0.2)..r_p(0,-0.2);

pickup pencircle scaled 2bp;


draw  A--B withcolor vert_e; draw g shifted B withcolor vert_e; draw g shifted A withcolor vert_e; 
label.top(btex $I=]-3\pv 3]$ etex, r_p(0,1) ) withcolor vert_e;

draw C--D withcolor red; draw g shifted D withcolor red;
label.top(btex $J=]-\infty\pv 1]$ etex, r_p(-3,1) ) withcolor red;

%draw C--B withcolor green; draw g shifted C withcolor green; draw g shifted B withcolor green;label.top(btex $I\cap J=]-1\pv %2]$ etex, r_p(1,1) ) %withcolor green;


draw A--D withcolor vert_e dashed withdots;
% draw d shifted D withcolor bleu; label.top(btex $I\cup J=]-\infty\pv 5[$ etex, r_p(0,1) ) withcolor bleu;




%r_fin;

endfig;









beginfig(17)


pair A,B,C,D;
A:=r_p(-1,0); B:=r_p(4,0);  C:=r_p(-3,0); D:=r_p(6.5,0);





path d,g;

d:=(1mm,1.5mm)--(0,1.5mm)--(0,-1.5mm)--(1mm,-1.5mm);
g:=(-1mm,1.5mm)--(0,1.5mm)--(0,-1.5mm)--(-1mm,-1.5mm);



%r_axes;

drawarrow r_p(-6.5,0)..r_p(6.5,0) ;
grad_x(1,1,.5white);
label.bot(btex 0 etex,r_p(0,-.2));
draw r_p(0,0.2)..r_p(0,-0.2);

pickup pencircle scaled 2bp;




draw C--D withcolor red; draw d shifted C withcolor red;
label.top(btex $J=[-3\pv +\infty[$ etex, r_p(4,1) ) withcolor red;

%draw C--B withcolor green; draw g shifted C withcolor green; draw g shifted B withcolor green;label.top(btex $I\cap J=]-1\pv %2]$ etex, r_p(1,1) ) %withcolor green;

draw  A--B withcolor vert_e dashed withdots; draw d shifted B withcolor vert_e; draw g shifted A withcolor vert_e; 
label.top(btex $I=]-1\pv 4[$ etex, r_p(1,1) ) withcolor vert_e;

%draw A--D withcolor vert_e dashed withdots;
% draw d shifted D withcolor bleu; label.top(btex $I\cup J=]-\infty\pv 5[$ etex, r_p(0,1) ) withcolor bleu;




%r_fin;

endfig;


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%
%
%     I N T E R S E C T I ON S
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



beginfig(18);
path a,b,aa,ab;
a=fullcircle scaled 2cm;
b=a shifted (0,1cm);
aa=halfcircle scaled 2cm;
ab=buildcycle(aa,b);
picture pa,pb,px;
pa=thelabel(btex $A$ etex, (0,-.5cm));
pb=thelabel(btex $A\cap B$ etex, (0,0.5cm));
px=thelabel(btex $B$ etex, (0,1.5cm));

fill b withcolor white;
fill a withcolor bleu_ciel;
%fill b withcolor bleu;
%fill ab withcolor bleu_fonce;
unfill bbox pa;
draw pa;
%unfill bbox pb;
%draw pb;
%unfill bbox px;
%draw px;
endfig;











beginfig(19);
path a,b,aa,ab;
a=fullcircle scaled 2cm;
b=a shifted (0,1cm);
aa=halfcircle scaled 2cm;
ab=buildcycle(aa,b);
picture pa,pb,px;
pa=thelabel(btex $A$ etex, (0,-.5cm));
pb=thelabel(btex $A\cap B$ etex, (0,0.5cm));
px=thelabel(btex $B$ etex, (0,1.5cm));

fill a withcolor bleu_ciel;
fill b withcolor bleu;
fill ab withcolor bleu_f;
unfill bbox pa;
draw pa;
%unfill bbox pb;
%draw pb;
unfill bbox px;
draw px;
endfig;











beginfig(20);
path a,b,aa,ab;
a=fullcircle scaled 2cm;
b=a shifted (0,1cm);
aa=halfcircle scaled 2cm;
ab=buildcycle(aa,b);
picture pa,pb,px;
pa=thelabel(btex $A$ etex, (0,-.5cm));
pb=thelabel(btex $A\cap B$ etex, (0,0.5cm));
px=thelabel(btex $B$ etex, (0,1.5cm));

fill a withcolor bleu_ciel;
fill b withcolor bleu;
fill ab withcolor bleu_f;
unfill bbox pa;
draw pa;
unfill bbox pb;
draw pb;
unfill bbox px;
draw px;
endfig;





beginfig(21);
path a,b,aa,ab;
a=fullcircle scaled 2cm;
b=a shifted (0,1cm);
aa=halfcircle scaled 2cm;
ab=buildcycle(aa,b);
picture pa,pb,px,pu;
pa=thelabel(btex $A$ etex, (0,-.5cm));
pb=thelabel(btex $A\cap B$ etex, (0,0.5cm));
px=thelabel(btex $B$ etex, (0,1.5cm));
pu=thelabel(btex $A\cup B$ etex, (0,0.5cm));


fill a withcolor bleu_m;
fill b withcolor bleu_m;
fill ab withcolor bleu_m;
unfill bbox pu;
draw pu;
endfig;































%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%
% T R I G O  N O M É T R I E 
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%









 beginfig(22)



 numeric u ;
 u=4.5cm;
 drawarrow (-1.2*u,0)--(1.2*u,0);
 drawarrow (0,-1.2*u)--(0,1.2*u);
 draw fullcircle scaled 9cm withpen pencircle scaled 1.3bp withcolor red;
 drawoptions(dashed evenly);
 path t[] ;
 t[1]=(u,0)--(cosd(60)*u,sind(60)*u)--(0,0);
 draw t[1] withcolor rose;
 for k=2 upto 6 : t[k]=t[1] rotatedaround ((0,0),60*(k-1));
   draw t[k] withcolor rose;
 endfor;
 path c[] ;
 c1 =(cosd(60)*u,-sind(60)*u)--(cosd(60)*u,sind(60)*u) ;
 draw c1 dashed evenly withcolor rose;
 c2 = c1 shifted (-u,0) ;
 draw c2 dashed evenly withcolor rose;
 z[1]=(u,0);
 for l=2 upto 6:
   z[l]=z[1] rotatedaround ((0,0),60(l-1));
 endfor;
 drawoptions();
 dotlabel.lrt(btex $0$ etex,(u,0));
 label.lrt(btex $1 \over2$ etex,(u/2,0))withcolor rose;
 label.lrt(btex $- {1 \over 2}$ etex,(-u/2,0))withcolor rose;
 dotlabel.llft(btex $\pi$ etex,(-u,0));

 label.urt(btex {${\pi \over 3}$} etex, z[2])withcolor rose;
 label.ulft(btex {${2\pi \over 3}$} etex,z[3])withcolor rose;
 label.llft(btex {$-{2\pi \over 3}$} etex,z[5])withcolor rose;
 label.lrt(btex {$-{\pi \over 3}$} etex,z[6])withcolor rose;
 label.llft(btex ${\sqrt{3} \over 2}$ etex,(0,sqrt(3)*u/2))withcolor rose;
 label.ulft(btex $-{\sqrt{3} \over 2}$ etex,(0,-sqrt(3)*u/2))withcolor rose;

%  drawoptions(dashed evenly);
%  path p[] ;
%  p[1]=(0,u)--(cosd(30)*u,sind(30)*u)--(0,0);
%  draw p[1] withcolor  orange;
%  for k=2 upto 6 : p[k]=p[1] rotatedaround ((0,0),60*(k-1));
%    draw p[k] withcolor orange;
%  endfor;
%  path s[] ;
%  s1 =(-cosd(30)*u,sind(30)*u)--(cosd(30)*u,sind(30)*u) ;
%  draw s1 dashed evenly withcolor  orange;
%  s2 = s1 shifted (0,-u) ;
%  draw s2 dashed evenly withcolor orange;

%  pair y[];
%  y[1]=(cosd(30)*u,sind(30)*u);
%  for l=2 upto 6:
%    y[l]=y[1] rotatedaround ((0,0),60(l-1));
%  endfor;
%  drawoptions();
%  label.urt(btex ${\pi \over 6}$ etex,y[1])withcolor orange;
%  dotlabel.urt(btex ${\pi \over 2}$ etex, y[2]);
%  label.ulft(btex ${5\pi \over 6}$ etex,y[3])withcolor orange;
%  label.llft(btex $-{5\pi \over 6}$ etex,y[4])withcolor orange;
%  label.llft(btex $-{\pi \over 2}$ etex,y[5])withcolor orange;
%  label.lrt(btex $-{\pi \over 6}$ etex,y[6])withcolor orange;
%  label.llft(btex ${\sqrt{3} \over 2}$ etex,(sqrt(3)*u/2,0))withcolor orange;
%  label.lrt(btex $-{\sqrt{3} \over 2}$ etex,(-sqrt(3)*u/2,0))withcolor orange;
%  label.llft(btex ${1 \over 2}$ etex,(0,u/2))withcolor orange;
%  label.llft(btex $-{1 \over 2}$ etex,(0,-u/2))withcolor orange;

%  drawoptions(dashed evenly);

%  path r[] ;
%  r[1]=(cosd(45)*u,-sind(45)*u)--(cosd(45)*u,sind(45)*u)--(0,0);
%  draw r[1] withcolor blue;
%  for k=2 upto 4 : r[k]=r[1] rotatedaround ((0,0),90*(k-1));
%    draw r[k] withcolor blue;
%  endfor;

%  pair w[];
%  w[1]=(u,0);
%  for n=2 upto 8:
%    w[n]=w[1] rotatedaround ((0,0),45(n-1));
%  endfor;
%  drawoptions();
%  label.urt(btex ${\pi \over 4}$ etex, w[2])withcolor blue;
%  dotlabel.urt(btex ${\pi \over 2}$ etex,w[3]);
%  label.ulft(btex ${3\pi \over 4}$ etex,w[4])withcolor blue;
% dotlabel.llft(btex ${\pi}$ etex,w[5]);
%  label.llft(btex $-{3\pi \over 4}$ etex,w[6])withcolor blue;
%  label.llft(btex $-{\pi \over 2}$ etex,w[7]);
%  label.lrt(btex $-{\pi \over 4}$ etex,w[8])withcolor blue;
%  label.ulft(btex ${\sqrt{2} \over 2}$ etex,(sqrt(2)*u/2,0))withcolor blue;
%  label.urt(btex $-{\sqrt{2} \over 2}$ etex,(-sqrt(2)*u/2,0))withcolor blue;
%  label.lrt(btex ${\sqrt{2} \over 2}$ etex,(0,sqrt(2)*u/2))withcolor blue ;
%  label.urt(btex $-{\sqrt{2} \over 2}$ etex,(0,-sqrt(2)*u/2))withcolor blue;

 endfig;











 beginfig(23)



 numeric u ;
 u=4.5cm;
 drawarrow (-1.2*u,0)--(1.2*u,0);
 drawarrow (0,-1.2*u)--(0,1.2*u);
 draw fullcircle scaled 9cm withpen pencircle scaled 1.3bp withcolor red;
 drawoptions(dashed evenly);
 % path t[] ;
%  t[1]=(u,0)--(cosd(60)*u,sind(60)*u)--(0,0);
%  draw t[1] withcolor rose;
%  for k=2 upto 6 : t[k]=t[1] rotatedaround ((0,0),60*(k-1));
%    draw t[k] withcolor rose;
%  endfor;
 % path c[] ;
%  c1 =(cosd(60)*u,-sind(60)*u)--(cosd(60)*u,sind(60)*u) ;
%  draw c1 dashed evenly withcolor rose;
%  c2 = c1 shifted (-u,0) ;
%  draw c2 dashed evenly withcolor rose;
%  z[1]=(u,0);
%  for l=2 upto 6:
%    z[l]=z[1] rotatedaround ((0,0),60(l-1));
%  endfor;
%  drawoptions();
%  dotlabel.lrt(btex $0$ etex,(u,0));
%  label.lrt(btex $1 \over2$ etex,(u/2,0))withcolor rose;
%  label.lrt(btex $- {1 \over 2}$ etex,(-u/2,0))withcolor rose;
%  dotlabel.llft(btex $\pi$ etex,(-u,0));

%  label.urt(btex {${\pi \over 3}$} etex, z[2])withcolor rose;
%  label.ulft(btex {${2\pi \over 3}$} etex,z[3])withcolor rose;
%  label.llft(btex {$-{2\pi \over 3}$} etex,z[5])withcolor rose;
%  label.lrt(btex {$-{\pi \over 3}$} etex,z[6])withcolor rose;
%  label.llft(btex ${\sqrt{3} \over 2}$ etex,(0,sqrt(3)*u/2))withcolor rose;
%  label.ulft(btex $-{\sqrt{3} \over 2}$ etex,(0,-sqrt(3)*u/2))withcolor rose;

  drawoptions(dashed evenly);
  path p[] ;
  p[1]=(0,u)--(cosd(30)*u,sind(30)*u)--(0,0);
  draw p[1] withcolor  orange;
  for k=2 upto 6 : p[k]=p[1] rotatedaround ((0,0),60*(k-1));
    draw p[k] withcolor orange;
  endfor;
  path s[] ;
  s1 =(-cosd(30)*u,sind(30)*u)--(cosd(30)*u,sind(30)*u) ;
  draw s1 dashed evenly withcolor  orange;
  s2 = s1 shifted (0,-u) ;
  draw s2 dashed evenly withcolor orange;

  pair y[];
  y[1]=(cosd(30)*u,sind(30)*u);
  for l=2 upto 6:
    y[l]=y[1] rotatedaround ((0,0),60(l-1));
  endfor;
  drawoptions();
  label.urt(btex ${\pi \over 6}$ etex,y[1])withcolor orange;
  dotlabel.urt(btex ${\pi \over 2}$ etex, y[2]);
  label.ulft(btex ${5\pi \over 6}$ etex,y[3])withcolor orange;
  label.llft(btex $-{5\pi \over 6}$ etex,y[4])withcolor orange;
  label.llft(btex $-{\pi \over 2}$ etex,y[5])withcolor orange;
  label.lrt(btex $-{\pi \over 6}$ etex,y[6])withcolor orange;
  label.llft(btex ${\sqrt{3} \over 2}$ etex,(sqrt(3)*u/2,0))withcolor orange;
  label.lrt(btex $-{\sqrt{3} \over 2}$ etex,(-sqrt(3)*u/2,0))withcolor orange;
  label.llft(btex ${1 \over 2}$ etex,(0,u/2))withcolor orange;
  label.llft(btex $-{1 \over 2}$ etex,(0,-u/2))withcolor orange;

%  drawoptions(dashed evenly);

%  path r[] ;
%  r[1]=(cosd(45)*u,-sind(45)*u)--(cosd(45)*u,sind(45)*u)--(0,0);
%  draw r[1] withcolor blue;
%  for k=2 upto 4 : r[k]=r[1] rotatedaround ((0,0),90*(k-1));
%    draw r[k] withcolor blue;
%  endfor;

%  pair w[];
%  w[1]=(u,0);
%  for n=2 upto 8:
%    w[n]=w[1] rotatedaround ((0,0),45(n-1));
%  endfor;
%  drawoptions();
%  label.urt(btex ${\pi \over 4}$ etex, w[2])withcolor blue;
%  dotlabel.urt(btex ${\pi \over 2}$ etex,w[3]);
%  label.ulft(btex ${3\pi \over 4}$ etex,w[4])withcolor blue;
% dotlabel.llft(btex ${\pi}$ etex,w[5]);
%  label.llft(btex $-{3\pi \over 4}$ etex,w[6])withcolor blue;
%  label.llft(btex $-{\pi \over 2}$ etex,w[7]);
%  label.lrt(btex $-{\pi \over 4}$ etex,w[8])withcolor blue;
%  label.ulft(btex ${\sqrt{2} \over 2}$ etex,(sqrt(2)*u/2,0))withcolor blue;
%  label.urt(btex $-{\sqrt{2} \over 2}$ etex,(-sqrt(2)*u/2,0))withcolor blue;
%  label.lrt(btex ${\sqrt{2} \over 2}$ etex,(0,sqrt(2)*u/2))withcolor blue ;
%  label.urt(btex $-{\sqrt{2} \over 2}$ etex,(0,-sqrt(2)*u/2))withcolor blue;

 endfig;



 




 beginfig(24)



 numeric u ;
 u=4.5cm;
 drawarrow (-1.2*u,0)--(1.2*u,0);
 drawarrow (0,-1.2*u)--(0,1.2*u);
 draw fullcircle scaled 9cm withpen pencircle scaled 1.3bp withcolor red;
 drawoptions(dashed evenly);
 % path t[] ;
%  t[1]=(u,0)--(cosd(60)*u,sind(60)*u)--(0,0);
%  draw t[1] withcolor rose;
%  for k=2 upto 6 : t[k]=t[1] rotatedaround ((0,0),60*(k-1));
%    draw t[k] withcolor rose;
%  endfor;
 % path c[] ;
%  c1 =(cosd(60)*u,-sind(60)*u)--(cosd(60)*u,sind(60)*u) ;
%  draw c1 dashed evenly withcolor rose;
%  c2 = c1 shifted (-u,0) ;
%  draw c2 dashed evenly withcolor rose;
%  z[1]=(u,0);
%  for l=2 upto 6:
%    z[l]=z[1] rotatedaround ((0,0),60(l-1));
%  endfor;
%  drawoptions();
%  dotlabel.lrt(btex $0$ etex,(u,0));
%  label.lrt(btex $1 \over2$ etex,(u/2,0))withcolor rose;
%  label.lrt(btex $- {1 \over 2}$ etex,(-u/2,0))withcolor rose;
%  dotlabel.llft(btex $\pi$ etex,(-u,0));

%  label.urt(btex {${\pi \over 3}$} etex, z[2])withcolor rose;
%  label.ulft(btex {${2\pi \over 3}$} etex,z[3])withcolor rose;
%  label.llft(btex {$-{2\pi \over 3}$} etex,z[5])withcolor rose;
%  label.lrt(btex {$-{\pi \over 3}$} etex,z[6])withcolor rose;
%  label.llft(btex ${\sqrt{3} \over 2}$ etex,(0,sqrt(3)*u/2))withcolor rose;
%  label.ulft(btex $-{\sqrt{3} \over 2}$ etex,(0,-sqrt(3)*u/2))withcolor rose;

%   drawoptions(dashed evenly);
%   path p[] ;
%   p[1]=(0,u)--(cosd(30)*u,sind(30)*u)--(0,0);
%   draw p[1] withcolor  orange;
%   for k=2 upto 6 : p[k]=p[1] rotatedaround ((0,0),60*(k-1));
%     draw p[k] withcolor orange;
%   endfor;
%   path s[] ;
%   s1 =(-cosd(30)*u,sind(30)*u)--(cosd(30)*u,sind(30)*u) ;
%   draw s1 dashed evenly withcolor  orange;
%   s2 = s1 shifted (0,-u) ;
%   draw s2 dashed evenly withcolor orange;

%   pair y[];
%   y[1]=(cosd(30)*u,sind(30)*u);
%   for l=2 upto 6:
%     y[l]=y[1] rotatedaround ((0,0),60(l-1));
%   endfor;
%   drawoptions();
%   label.urt(btex ${\pi \over 6}$ etex,y[1])withcolor orange;
%   dotlabel.urt(btex ${\pi \over 2}$ etex, y[2])withcolor orange;
%   label.ulft(btex ${5\pi \over 6}$ etex,y[3])withcolor orange;
%   label.llft(btex $-{5\pi \over 6}$ etex,y[4])withcolor orange;
%   label.llft(btex $-{\pi \over 2}$ etex,y[5])withcolor orange;
%   label.lrt(btex $-{\pi \over 6}$ etex,y[6])withcolor orange;
%   label.llft(btex ${\sqrt{3} \over 2}$ etex,(sqrt(3)*u/2,0))withcolor orange;
%   label.lrt(btex $-{\sqrt{3} \over 2}$ etex,(-sqrt(3)*u/2,0))withcolor orange;
%   label.llft(btex ${1 \over 2}$ etex,(0,u/2))withcolor orange;
%   label.llft(btex $-{1 \over 2}$ etex,(0,-u/2))withcolor orange;

  drawoptions(dashed evenly);

  path r[] ;
  r[1]=(cosd(45)*u,-sind(45)*u)--(cosd(45)*u,sind(45)*u)--(0,0);
  draw r[1] withcolor blue;
  for k=2 upto 4 : r[k]=r[1] rotatedaround ((0,0),90*(k-1));
    draw r[k] withcolor blue;
  endfor;

  pair w[];
  w[1]=(u,0);
  for n=2 upto 8:
    w[n]=w[1] rotatedaround ((0,0),45(n-1));
  endfor;
  drawoptions();
  label.urt(btex ${\pi \over 4}$ etex, w[2])withcolor blue;
  dotlabel.urt(btex ${\pi \over 2}$ etex,w[3]);
  label.ulft(btex ${3\pi \over 4}$ etex,w[4])withcolor blue;
 dotlabel.llft(btex ${\pi}$ etex,w[5]);
  label.llft(btex $-{3\pi \over 4}$ etex,w[6])withcolor blue;
  label.llft(btex $-{\pi \over 2}$ etex,w[7]);
  label.lrt(btex $-{\pi \over 4}$ etex,w[8])withcolor blue;
  label.ulft(btex ${\sqrt{2} \over 2}$ etex,(sqrt(2)*u/2,0))withcolor blue;
  label.urt(btex $-{\sqrt{2} \over 2}$ etex,(-sqrt(2)*u/2,0))withcolor blue;
  label.lrt(btex ${\sqrt{2} \over 2}$ etex,(0,sqrt(2)*u/2))withcolor blue ;
  label.urt(btex $-{\sqrt{2} \over 2}$ etex,(0,-sqrt(2)*u/2))withcolor blue;

 endfig;






beginfig(25)



numeric u ;
u=4.5cm;
drawarrow (-1.2*u,0)--(1.2*u,0);
drawarrow (0,-1.2*u)--(0,1.2*u);
draw fullcircle scaled 9cm withpen pencircle scaled 1.3bp withcolor red;
drawoptions(dashed evenly);
path t[] ;
t[1]=(u,0)--(cosd(60)*u,sind(60)*u)--(0,0);
draw t[1] withcolor rose;
for k=2 upto 6 : t[k]=t[1] rotatedaround ((0,0),60*(k-1));
  draw t[k] withcolor rose;
endfor;
path c[] ;
c1 =(cosd(60)*u,-sind(60)*u)--(cosd(60)*u,sind(60)*u) ;
draw c1 dashed evenly withcolor rose;
c2 = c1 shifted (-u,0) ;
draw c2 dashed evenly withcolor rose;
z[1]=(u,0);
for l=2 upto 6:
  z[l]=z[1] rotatedaround ((0,0),60(l-1));
endfor;
drawoptions();
dotlabel.lrt(btex $0$ etex,(u,0));
label.lrt(btex $1 \over2$ etex,(u/2,0))withcolor rose;
label.lrt(btex $- {1 \over 2}$ etex,(-u/2,0))withcolor rose;
dotlabel.llft(btex $\pi$ etex,(-u,0));

label.urt(btex {${\pi \over 3}$} etex, z[2])withcolor rose;
label.ulft(btex {${2\pi \over 3}$} etex,z[3])withcolor rose;
label.llft(btex {$-{2\pi \over 3}$} etex,z[5])withcolor rose;
label.lrt(btex {$-{\pi \over 3}$} etex,z[6])withcolor rose;
label.llft(btex ${\sqrt{3} \over 2}$ etex,(0,sqrt(3)*u/2))withcolor rose;
label.ulft(btex $-{\sqrt{3} \over 2}$ etex,(0,-sqrt(3)*u/2))withcolor rose;

drawoptions(dashed evenly);
path p[] ;
p[1]=(0,u)--(cosd(30)*u,sind(30)*u)--(0,0);
draw p[1] withcolor  orange;
for k=2 upto 6 : p[k]=p[1] rotatedaround ((0,0),60*(k-1));
  draw p[k] withcolor orange;
endfor;
path s[] ;
s1 =(-cosd(30)*u,sind(30)*u)--(cosd(30)*u,sind(30)*u) ;
draw s1 dashed evenly withcolor  orange;
s2 = s1 shifted (0,-u) ;
draw s2 dashed evenly withcolor orange;

pair y[];
y[1]=(cosd(30)*u,sind(30)*u);
for l=2 upto 6:
  y[l]=y[1] rotatedaround ((0,0),60(l-1));
endfor;
drawoptions();
label.urt(btex ${\pi \over 6}$ etex,y[1])withcolor orange;
dotlabel.urt(btex ${\pi \over 2}$ etex, y[2]);
label.ulft(btex ${5\pi \over 6}$ etex,y[3])withcolor orange;
label.llft(btex $-{5\pi \over 6}$ etex,y[4])withcolor orange;
label.llft(btex $-{\pi \over 2}$ etex,y[5])withcolor orange;
label.lrt(btex $-{\pi \over 6}$ etex,y[6])withcolor orange;
label.llft(btex ${\sqrt{3} \over 2}$ etex,(sqrt(3)*u/2,0))withcolor orange;
label.lrt(btex $-{\sqrt{3} \over 2}$ etex,(-sqrt(3)*u/2,0))withcolor orange;
label.llft(btex ${1 \over 2}$ etex,(0,u/2))withcolor orange;
label.llft(btex $-{1 \over 2}$ etex,(0,-u/2))withcolor orange;

drawoptions(dashed evenly);

path r[] ;
r[1]=(cosd(45)*u,-sind(45)*u)--(cosd(45)*u,sind(45)*u)--(0,0);
draw r[1] withcolor blue;
for k=2 upto 4 : r[k]=r[1] rotatedaround ((0,0),90*(k-1));
  draw r[k] withcolor blue;
endfor;

pair w[];
w[1]=(u,0);
for n=2 upto 8:
  w[n]=w[1] rotatedaround ((0,0),45(n-1));
endfor;
drawoptions();
label.urt(btex ${\pi \over 4}$ etex, w[2])withcolor blue;
dotlabel.urt(btex ${\pi \over 2}$ etex,w[3]);
label.ulft(btex ${3\pi \over 4}$ etex,w[4])withcolor blue;
dotlabel.llft(btex ${\pi}$ etex,w[5]);
label.llft(btex $-{3\pi \over 4}$ etex,w[6])withcolor blue;
label.llft(btex $-{\pi \over 2}$ etex,w[7]);
label.lrt(btex $-{\pi \over 4}$ etex,w[8])withcolor blue;
label.ulft(btex ${\sqrt{2} \over 2}$ etex,(sqrt(2)*u/2,0))withcolor blue;
label.urt(btex $-{\sqrt{2} \over 2}$ etex,(-sqrt(2)*u/2,0))withcolor blue;
label.lrt(btex ${\sqrt{2} \over 2}$ etex,(0,sqrt(2)*u/2))withcolor blue ;
label.urt(btex $-{\sqrt{2} \over 2}$ etex,(0,-sqrt(2)*u/2))withcolor blue;

endfig;


















%avant la spirale




 
beginfig(26 )

  numeric u;
  u:=0.5cm;
%%
%%%%%%%%%%%%%%%%%%%%%
repere(0,0,-3,3,-2.5,2.5,1cm,1cm);
r_axes;
r_origine;
%r_unites;
r_labelxy;


draw (2.05u,0)--(2.05u,4u) withpen pencircle scaled 1.5bp withcolor red;
drawarrow (2.05u,4u)--(2.05u,5u ) withpen pencircle scaled 1.5bp withcolor red dashed evenly;

draw (2.05u ,0)--(2.05u ,-3.75u ) withpen pencircle scaled 1.5bp withcolor blue;

draw (2.05u ,-3.75u )--(2.05u ,-5u ) withpen pencircle scaled 1.5bp withcolor blue dashed evenly;

%le cercle
draw fullcircle scaled 2.05cm;


label.urt(btex $0$ etex,(2.05u ,0) );
dotlabel.rt(btex $-1$ etex,(2.05u ,-2.05u ) );
dotlabel.rt(btex $1$ etex,(2.05u ,2.05u ) );
dotlabel.rt(btex $0,5$ etex,(2.05u,1.025u) );
dotlabel.rt(btex $\sqrt{2}$ etex,(2.05u,2.9u) );
label.lrt(btex $\bbr$ etex,(2.05u,4.75u) )withcolor red;
r_fin;

endfig;



%spirale

 
beginfig(27 )


%%%%%%%%%%%%%%%%%%%%%%%
vardef fx(expr t)=
        t*cos(t)/(2*Pi)
enddef;

vardef fy(expr t)=
         t*sin(t)/(2*Pi)                      % spirale passant par (1,0)
enddef;
%%%%%%%%%%%%%%%%%%%%%
repere(0,0,-3,3,-2.5,2.5,2cm,2cm);
r_axes;
r_origine;
%r_unites;
r_labelxy;



%On se débrouille pour que le cercle unite soit le cercle osculateur de la spirale :
%On fait une translation de (0,-1/(2Pi)) suivi d'une rotation de -Arctan(1/(2*pi)) autour de  (0,1/(2Pi))
path s,ss,S,sp,Sp,ssp;
s:=(f_courbe(fx,fy,2*Pi,13*Pi/3,1000) shifted r_p(0,-1/(2*Pi))) rotatedaround(r_p(0,1/(2*Pi)),9.043061);
draw s withpen pencircle scaled 1.5bp withcolor red;
sp:=(f_courbe(fx,fy,13*Pi/3,13*Pi/3+Pi/6,1000) shifted r_p(0,-1/(2*Pi))) rotatedaround(r_p(0,1/(2*Pi)),9.043061);
drawarrow ((f_point(fx,fy,13*Pi/3+Pi/6-0.05)-- f_point(fx,fy,13*Pi/3+Pi/6)) shifted r_p(0,-1/(2*Pi))) rotatedaround(r_p(0,1/(2*Pi)),9.043061)withcolor red dashed evenly;
label.top(btex $\bbr$ etex,(f_point(fx,fy,13*Pi/3+Pi/6) shifted r_p(0,-1/(2*Pi)))rotatedaround(r_p(0,1/(2*Pi)),9.043061))withcolor red;
draw sp withpen pencircle scaled 1.5bp withcolor red dashed evenly;
% vers les négatifs
ss:=(f_courbe(fx,fy,2*Pi,8*Pi/3,1000) shifted r_p(0,-1/(2*Pi))) rotatedaround(r_p(0,1/(2*Pi)),9.043061);
S:=ss reflectedabout(r_p(0,0),r_p(1,0)); 
draw S withpen pencircle scaled 1.5bp withcolor blue;
ssp:=(f_courbe(fx,fy,8*Pi/3,8*Pi/3+Pi/6,1000) shifted r_p(0,-1/(2*Pi))) rotatedaround(r_p(0,1/(2*Pi)),9.043061);
Sp:=ssp reflectedabout(r_p(0,0),r_p(1,0));
draw Sp withpen pencircle scaled 1.5bp withcolor blue dashed evenly;
%le cercle
draw fullcircle scaled 4.1cm withcolor orange;

pair a[];



a[1/2]:=(f_point(fx,fy,2*Pi+0.48) shifted r_p(0,-1/(2*Pi))) rotatedaround(r_p(0,1/(2*Pi)),9.043061);
dotlabel.rt(btex 0.5 etex,a[1/2] );


a[1.414]:=(f_point(fx,fy,2*Pi+1.27) shifted r_p(0,-1/(2*Pi))) rotatedaround(r_p(0,1/(2*Pi)),9.043061);
dotlabel.top(btex $\sqrt{2}$ etex,a[1.414] );



a[1]:=(f_point(fx,fy,2*Pi+0.9) shifted r_p(0,-1/(2*Pi))) rotatedaround(r_p(0,1/(2*Pi)),9.043061);
dotlabel.urt(btex $1$ etex,a[1] );



a[5/2]:=(f_point(fx,fy,2*Pi+2.15) shifted r_p(0,-1/(2*Pi))) rotatedaround(r_p(0,1/(2*Pi)),9.043061);
dotlabel.ulft(btex $\fr{5}{2}$ etex,a[5/2] );



a[3.14]:=(f_point(fx,fy,2*Pi+2.6) shifted r_p(0,-1/(2*Pi))) rotatedaround(r_p(0,1/(2*Pi)),9.043061);
dotlabel.ulft(btex $\pi$ etex,a[3.14] );



a[6.28]:=(f_point(fx,fy,2*Pi+4.6) shifted r_p(0,-1/(2*Pi))) rotatedaround(r_p(0,1/(2*Pi)),9.043061);
dotlabel.lrt(btex $2\pi$ etex,a[6.28] );


a[7.28]:=(f_point(fx,fy,2*Pi+5.14) shifted r_p(0,-1/(2*Pi))) rotatedaround(r_p(0,1/(2*Pi)),9.043061);
dotlabel.lrt(btex $2\pi+1$ etex,a[7.28] );




drawarrow a[5/2]{dir -85}..(-1.61cm,1.203cm){dir -45} dashed evenly;

drawarrow a[3.14]{dir -85}..(-2.05cm,0){dir -25} dashed evenly;



drawarrow a[6.28]{dir 20}..(2.05cm,0){dir 135} dashed evenly;

drawarrow a[7.28]{dir 50}..a[1]{dir 185} dashed evenly;

label.urt(btex $0$ etex,(2.05cm,0) );
dotlabel.lrt(btex $-1$ etex,(1.086cm,-1.75cm) );



r_fin;
endfig;

    




%la galette des rois





beginfig(28)



numeric u ;
u=2.5cm;
drawarrow (-1.2*u,0)--(1.2*u,0);
drawarrow (0,-1.2*u)--(0,1.2*u);
draw fullcircle scaled 2u withpen pencircle scaled 1.3bp withcolor red;
drawoptions(dashed evenly);
path t[] ;
t[1]=(cosd(60)*u,sind(60)*u)--(0,0);
draw t[1] withcolor rose;
for k=2 upto 6 : t[k]=t[1] rotatedaround ((0,0),60*(k-1));
  draw t[k] withcolor rose;
endfor;
path c[] ;
c1 =(cosd(60)*u,-sind(60)*u)--(cosd(60)*u,sind(60)*u) ;
%draw c1 dashed evenly withcolor rose;
c2 = c1 shifted (-u,0) ;
%draw c2 dashed evenly withcolor rose;
z[1]=(u,0);
for l=2 upto 6:
  z[l]=z[1] rotatedaround ((0,0),60(l-1));
endfor;
drawoptions();
dotlabel.lrt(btex $0$ etex,(u,0));
%label.lrt(btex $1 \over2$ etex,(u/2,0))withcolor rose;
%label.lrt(btex $- {1 \over 2}$ etex,(-u/2,0))withcolor rose;
dotlabel.llft(btex $\pi$ etex,(-u,0));

label.urt(btex {${\pi \over 3}$} etex, z[2])withcolor rose;
label.ulft(btex {${2\pi \over 3}$} etex,z[3])withcolor rose;
label.llft(btex {$-{2\pi \over 3}$} etex,z[5])withcolor rose;
label.lrt(btex {$-{\pi \over 3}$} etex,z[6])withcolor rose;
%label.llft(btex ${\sqrt{3} \over 2}$ etex,(0,sqrt(3)*u/2))withcolor rose;
%label.ulft(btex $-{\sqrt{3} \over 2}$ etex,(0,-sqrt(3)*u/2))withcolor rose;

drawoptions(dashed evenly);
path p[] ;
p[1]=(cosd(30)*u,sind(30)*u)--(0,0);
draw p[1] withcolor  orange;
for k=2 upto 6 : p[k]=p[1] rotatedaround ((0,0),60*(k-1));
  draw p[k] withcolor orange;
endfor;
path s[] ;
s1 =(-cosd(30)*u,sind(30)*u)--(cosd(30)*u,sind(30)*u) ;
%draw s1 dashed evenly withcolor  orange;
s2 = s1 shifted (0,-u) ;
%draw s2 dashed evenly withcolor orange;

pair y[];
y[1]=(cosd(30)*u,sind(30)*u);
for l=2 upto 6:
  y[l]=y[1] rotatedaround ((0,0),60(l-1));
endfor;
drawoptions();
label.urt(btex ${\pi \over 6}$ etex,y[1])withcolor orange;
dotlabel.urt(btex ${\pi \over 2}$ etex, y[2]);
label.ulft(btex ${5\pi \over 6}$ etex,y[3])withcolor orange;
label.llft(btex $-{5\pi \over 6}$ etex,y[4])withcolor orange;
label.llft(btex $-{\pi \over 2}$ etex,y[5])withcolor orange;
label.lrt(btex $-{\pi \over 6}$ etex,y[6])withcolor orange;
%label.llft(btex ${\sqrt{3} \over 2}$ etex,(sqrt(3)*u/2,0))withcolor orange;
%label.lrt(btex $-{\sqrt{3} \over 2}$ etex,(-sqrt(3)*u/2,0))withcolor orange;
%label.llft(btex ${1 \over 2}$ etex,(0,u/2))withcolor orange;
%label.llft(btex $-{1 \over 2}$ etex,(0,-u/2))withcolor orange;

drawoptions(dashed evenly);

path r[] ;
r[1]=(cosd(45)*u,sind(45)*u)--(0,0);
draw r[1] withcolor blue;
for k=2 upto 4 : r[k]=r[1] rotatedaround ((0,0),90*(k-1));
  draw r[k] withcolor blue;
endfor;

pair w[];
w[1]=(u,0);
for n=2 upto 8:
  w[n]=w[1] rotatedaround ((0,0),45(n-1));
endfor;
drawoptions();
label.urt(btex ${\pi \over 4}$ etex, w[2])withcolor blue;
dotlabel.urt(btex ${\pi \over 2}$ etex,w[3]);
label.ulft(btex ${3\pi \over 4}$ etex,w[4])withcolor blue;
dotlabel.llft(btex ${\pi}$ etex,w[5]);
label.llft(btex $-{3\pi \over 4}$ etex,w[6])withcolor blue;
label.llft(btex $-{\pi \over 2}$ etex,w[7]);
label.lrt(btex $-{\pi \over 4}$ etex,w[8])withcolor blue;
%label.ulft(btex ${\sqrt{2} \over 2}$ etex,(sqrt(2)*u/2,0))withcolor blue;
%label.urt(btex $-{\sqrt{2} \over 2}$ etex,(-sqrt(2)*u/2,0))withcolor blue;
%label.lrt(btex ${\sqrt{2} \over 2}$ etex,(0,sqrt(2)*u/2))withcolor blue ;
%label.urt(btex $-{\sqrt{2} \over 2}$ etex,(0,-sqrt(2)*u/2))withcolor blue;

endfig;



%% Sin, Cos, Tan

beginfig(29);
numeric u;
u=2.5cm ;
drawarrow (-1.2*u,0)--(1.2*u,0);
drawarrow (0,-1.2*u)--(0,1.2*u);
draw fullcircle scaled 5cm withcolor bleu;
draw (0,0)--(cosd(40)*u,sind(40)*u) withpen pencircle scaled 1.2bp;
draw (0,sind(40)*u)--(cosd(40)*u,sind(40)*u) dashed evenly withpen pencircle scaled 1.2bp withcolor red;
draw (cosd(40)*u,0)--(cosd(40)*u,sind(40)*u) dashed evenly withpen pencircle scaled 1.2bp withcolor orange;
%draw (u,-1.3*u)--(u,1.3*u)withpen pencircle scaled 1.2bp withcolor rose;
drawarrow (0.2*u,0){dir 90}..(0.2*cosd(40)*u,0.2*sind(40)*u);
dotlabel.llft(btex $0$ etex, (0,0));
dotlabel.lrt(btex $I$ etex, (u,0));
dotlabel.ulft(btex $J$ etex, (0,u));
label.lft(btex $\sin(x)$ etex, (0,sind(40)*u))withcolor red;
label.bot(btex $\cos(x)$ etex, (cosd(40)*u,0))withcolor  orange;
%label.rt(btex $\tan(x)$ etex , (u,(sind(40)/cosd(40))*u)) withcolor rose;
dotlabel.top(btex $x$ etex,(cosd(40)*u,sind(40)*u));
endfig;


%fig 30  lien triangle 3eme
_nfig:=29;
numeric u;
u=4cm ;
figure(-.25u,-.25u,1.5u,1.5u);
pair O,I,J,M,C;
drawarrow (-1.2*u,0)--(1.2*u,0)dashed evenly;
drawarrow (0,-1.2*u)--(0,1.2*u)dashed evenly;
draw cercle(origin,u) withcolor blue dashed evenly;
O=origin;
I=(u,0);
J=(0,u);
M=(cosd(40)*u,sind(40)*u);C=(cosd(40)*u,0);
trace segment(O,M)withpen pencircle scaled 1.2bp;
trace segment(M,C) withcolor orange withpen pencircle scaled 1.2bp;
trace segment(O,C) withcolor red withpen pencircle scaled 1.2bp;
%trace Codeangle(O,C,M,1,btex x etex );
drawarrow (0.2*u,0){dir 90}..(0.2*cosd(40)*u,0.2*sind(40)*u);
trace codeperp(O,C,M,5);

label.rt(btex $x$ etex,(0.2*cosd(40)*u,0.2*sind(20)*u) );
dotlabel.llft(btex $0$ etex, (0,0));
dotlabel.lrt(btex $I$ etex, (u,0));
dotlabel.ulft(btex $J$ etex, (0,u));
%label.lft(btex $\sin(x)$ etex, (0,sind(40)*u))withcolor red;
label.bot(btex $C$ etex, (cosd(40)*u,0))withcolor  red;

dotlabel.urt(btex $M$ etex,(cosd(40)*u,sind(40)*u));

trace appelation(O,C,-2mm,btex \footnotesize \color{red}$\cos(x)$ etex );

trace appelation(C,M,-2mm,btex \footnotesize \color{orange}$\sin(x)$ etex );

trace appelation(O,M,2mm,btex \small 1 etex );
fin;








% fig 31 triangle equi

numeric u;
u=4cm ;
figure(-.25u,-.25u,1.5u,1.5u);
pair O,I,J,M,C;
drawarrow (-1.2*u,0)--(1.2*u,0)dashed evenly;
drawarrow (0,-1.2*u)--(0,1.2*u)dashed evenly;
draw cercle(origin,u) withcolor blue dashed evenly;
O=origin;
I=(u,0);
J=(0,u);
M=(cosd(60)*u,sind(60)*u);C=(cosd(60)*u,0);
trace segment(O,M)withpen pencircle scaled 1.2bp;
trace segment(M,C) withcolor orange withpen pencircle scaled 1.2bp;
trace segment(O,C) withcolor red withpen pencircle scaled 1.2bp;
trace segment(M,I);
%trace Codeangle(O,C,M,1,btex x etex );
drawarrow (0.2*u,0){dir 90}..(0.2*cosd(60)*u,0.2*sind(60)*u);
drawarrow ((0.2*cosd(60)*u,0.2*sind(60)*u){dir -30}..(0.2*u,0){dir -90}) reflectedabout(M,C);
trace codeperp(O,C,M,5);

label.rt(btex $\small\ofr{\pi}{3}$ etex,(0.3*cosd(60)*u,0.3*sind(30)*u) );
label.lft(btex $\small \alpha$ etex,(0.3*cosd(60)*u,0.3*sind(30)*u)  reflectedabout(M,C));
dotlabel.llft(btex $0$ etex, (0,0));
dotlabel.lrt(btex $I$ etex, (u,0));
dotlabel.ulft(btex $J$ etex, (0,u));
%label.lft(btex $\sin\pa{\ofr{\pi}{3}}$ etex, (0,sind(60)*u))withcolor red;
label.bot(btex $C$ etex, (cosd(60)*u,0))withcolor  red;

dotlabel.urt(btex $M$ etex,(cosd(60)*u,sind(60)*u));

trace appelation(O,C,-2mm,btex \footnotesize \color{red}$\cos\pa{\ofr{\pi}{3}}$ etex );

trace appelation(C,M,-2mm,btex \footnotesize \color{orange}$\sin\pa{\ofr{\pi}{3}}$ etex );

trace appelation(O,M,2mm,btex \small 1 etex );
fin;















%fig 32 cercle trigo paire impaire
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


figure(-1.25u,-1.25u,1.25u,1.25u);
numeric u;
u=3cm ;
drawarrow (-1.2*u,0)--(1.2*u,0);
drawarrow (0,-1.2*u)--(0,1.2*u);
draw fullcircle scaled 6cm withcolor blue;
draw (0,0)--(u,(cosd(45)/sind(45))*u) withcolor red;
draw (0,0)--(u,-(cosd(45)/sind(45))*u)withcolor vert_e;
draw (cosd(45)*u,-sind(45)*u)--(cosd(45)*u,sind(45)*u) dashed evenly;
draw (0,-sind(45)*u)--(cosd(45)*u,-sind(45)*u) dashed evenly;
draw (0,sind(45)*u)--(cosd(45)*u,sind(45)*u) dashed evenly;
%draw (u,-1.3*u)--(u,1.3*u);
drawarrow (0.2*u,0){dir 90}..(0.2*cosd(45)*u,0.2*sind(45)*u);
drawarrow (0.2*u,0){dir -90}..(0.2*cosd(45)*u,-0.2*sind(45)*u);
dotlabel.ulft(btex $0$ etex, (0,0));
dotlabel.lrt(btex $I$ etex, (u,0));
dotlabel.ulft(btex $J$ etex, (0,u));
dotlabel.lft(btex   \footnotesize $\sin(x)$ etex, (0,sind(45)*u));
dotlabel.lft(btex \footnotesize $-\sin(x)$ etex, (0,-sind(45)*u));
dotlabel.urt(btex  \footnotesize $\cos(x)$ etex, (cosd(45)*u,0));
%dotlabel.rt(btex $\tan(x)$ etex , (u,(sind(45)/cosd(45))*u));
%dotlabel.rt(btex $-\tan(x)$ etex , (u,-(sind(45)/cosd(45))*u));
label.top(btex $x$ etex,(cosd(45)*u,sind(45)*u));
label.bot(btex $-x$ etex,(cosd(45)*u,(-sind(45)-0.05)*u));
endfig;














% fig 33
%parite
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
figure(-3u,-2u,3u,2u);
numeric u;
u=2cm ;



%%%%%%%%%%%%%%%%%%%%%%%
vardef fx(expr t)=
t
enddef;

vardef fy(expr t)=
           t*t*t*t-2*t*t -1                  % c'est la seule ligne à changer
enddef;
%%%%%%%%%%%%%%%%%%%%%
repere(0,0,-2,2,-2,2,3cm,2cm);

fillcolor:=jaune;
transparence r_p(-3,-3)--r_p(0,-3)--r_p(0,3)--r_p(-3,3)--cycle;

r_axes;
r_origine;

r_labelxy;


draw f_courbe(fx,fy,0,2,500)withpen pencircle scaled 1.5bp withcolor red;
draw f_courbe(fx,fy,-2,0,500)withpen pencircle scaled 1.5bp withcolor red dashed withdots scaled 0.5;

pair X,mX,fX,fmX,Y;
numeric a;
a:=.5;
mX=r_p(-a,0); X=r_p(a,0); fX=f_point(fx,fy,a); fmX=r_p(fx(-a),fy(-a)); Y=r_p(0,fy(a));

drawarrow mX--fmX; drawarrow fmX--Y; drawarrow fX--Y; drawarrow X--fX;

dotlabel.top(btex $-x$ etex,mX );
dotlabel.top(btex $x$ etex,X );
dotlabel.llft(btex $f(-x)$ etex,Y );
dotlabel.lrt(btex $f(x)$ etex,Y );




r_fin;
endfig;
 












% fig 34
%  imparite
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
figure(-3u,-2u,3u,2u);
numeric u;
u=2cm ;



%%%%%%%%%%%%%%%%%%%%%%%
vardef fx(expr t)=
t
enddef;

vardef fy(expr t)=
           0.25*t*t*t                  % c'est la seule ligne à changer
enddef;
%%%%%%%%%%%%%%%%%%%%%
repere(0,0,-2,2,-2,2,3cm,2cm);

fillcolor:=jaune;
transparence r_p(-3,-3)--r_p(0,-3)--r_p(0,3)--r_p(-3,3)--cycle;

r_axes;
%r_origine;

r_labelxy;


draw f_courbe(fx,fy,0,2,500)withpen pencircle scaled 1.5bp withcolor red;
draw f_courbe(fx,fy,-2,0,500)withpen pencircle scaled 1.5bp withcolor red dashed withdots scaled 0.5;

pair X,mX,fX,fmX,Y,mY;
numeric a;
a:=1.5;
mX=r_p(-a,0); X=r_p(a,0); fX=f_point(fx,fy,a); fmX=r_p(fx(-a),fy(-a)); Y=r_p(0,fy(a)); mY=r_p(0,fy(-a));

drawarrow mX--fmX; drawarrow fmX--mY; drawarrow fX--Y; drawarrow X--fX;

trace segment(fX,fmX);
trace codesegments(fmX,r_p(0,0),r_p(0,0),fX,2);

dotlabel.top(btex $-x$ etex,mX );
dotlabel.bot(btex $x$ etex,X );
dotlabel.lrt(btex $f(-x)$ etex,mY );
dotlabel.llft(btex $f(x)$ etex,Y );
label.lrt(btex O etex,origin );



r_fin;
endfig;
 












% fig 35
%cosinus
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  numeric u;
u=2cm ;
figure(-3.5u,-1.25u,3.5u,1.25u);



%%%%%%%%%%%%%%%%%%%%%%%
vardef fx(expr t)=
t
enddef;

vardef fy(expr t)=
           cos(t)                  % c'est la seule ligne à changer
enddef;
%%%%%%%%%%%%%%%%%%%%%
repere(0,0,-3.5,3.5,-1.25,1.25,2cm,2cm);

fillcolor:=jaune;
transparence r_p(-4,-3)--r_p(0,-3)--r_p(0,3)--r_p(-4,3)--cycle;

r_axes;
r_origine;
%r_unites;
r_labelxy;


draw f_courbe(fx,fy,0,Pi,500)withpen pencircle scaled 1.5bp withcolor red;
draw f_courbe(fx,fy,-Pi,0,500)withpen pencircle scaled 1.5bp withcolor red dashed withdots scaled 0.5;

pair X,mX,fX,fmX,Y;
numeric a;
a:=Pi;
mX:=r_p(-Pi,0); X:=r_p(a,0); fX:=f_point(fx,fy,a); fmX:=r_p(-a,fy(-a)); Y:=r_p(0,fy(a)); mY:=r_p(0,fy(-a));

drawarrow mX--fmX; drawarrow fmX--Y; drawarrow fX--Y; drawarrow X--fX;

dotlabel.top(btex $-\pi$ etex,mX );
dotlabel.top(btex $\pi$ etex,X );
dotlabel.llft(btex $-1$ etex,mY );
dotlabel.urt(btex $1$ etex,r_p(0,1) );
label.urt(btex $\ofr{\pi}{2}$ etex,r_p(Pi/2,0) );
label.ulft(btex $-\ofr{\pi}{2}$ etex,r_p(-Pi/2,0) );


r_fin;
endfig;
 






% fig 36
%
%sinus
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   numeric u;
u=2cm ;
figure(-3.5u,-1.25u,3.5u,1.25u);




%%%%%%%%%%%%%%%%%%%%%%%
vardef fx(expr t)=
t
enddef;

vardef fy(expr t)=
          sin(t)                  % c'est la seule ligne à changer
enddef;
%%%%%%%%%%%%%%%%%%%%%
repere(0,0,-3.5,3.5,-1.25,1.25,2cm,2cm);

fillcolor:=jaune;
transparence r_p(-4,-3)--r_p(0,-3)--r_p(0,3)--r_p(-4,3)--cycle;

r_axes;
%r_origine;

r_labelxy;


draw f_courbe(fx,fy,0,Pi,500)withpen pencircle scaled 1.5bp withcolor red;
draw f_courbe(fx,fy,-Pi,0,500)withpen pencircle scaled 1.5bp withcolor red dashed withdots scaled 0.5;

pair X,mX,fX,fmX,Y,mY;
numeric a;
a:=Pi/2;
mX=r_p(-a,0); X=r_p(a,0); fX=f_point(fx,fy,a); fmX=r_p(fx(-a),fy(-a)); Y=r_p(0,fy(a)); mY=r_p(0,fy(-a));

drawarrow mX--fmX; drawarrow fmX--mY; drawarrow fX--Y; drawarrow X--fX;

%trace segment(fX,fmX);
%trace codesegments(fmX,r_p(0,0),r_p(0,0),fX,2);

dotlabel.top(btex $-\ofr{\pi}{2}$ etex,mX );
dotlabel.bot(btex $\ofr{\pi}{2}$ etex,X );
dotlabel.lrt(btex $-1$ etex,mY );
dotlabel.llft(btex $1$ etex,Y );
label.lrt(btex O etex,origin );

dotlabel.top(btex $-\pi$ etex,r_p(-Pi,0) );
dotlabel.bot(btex $\pi$ etex,r_p(Pi,0) );

r_fin;
endfig;
 












% FIG 37 : p É RIO DI CI Té
%
%

 numeric u;
u=2.75cm ;
figure(-3.5u,-1.25u,3.5u,1.25u);




%%%%%%%%%%%%%%%%%%%%%%%
vardef fx(expr t)=
t
enddef;

vardef fy(expr t)=
          sin(t)                  % c'est la seule ligne à changer
enddef;
%%%%%%%%%%%%%%%%%%%%%
repere(0,0,-14,14,-1.25,1.25,0.75cm,2.5cm);

fillcolor:=jaune;
transparence r_p(-Pi,-3)--r_p(Pi,-3)--r_p(Pi,3)--r_p(-Pi,3)--cycle;

r_axes;
%r_origine;

r_labelxy;


draw f_courbe(fx,fy,-Pi,Pi,500)withpen pencircle scaled 1.5bp withcolor red;
draw f_courbe(fx,fy,-3*Pi,-Pi,500)withpen pencircle scaled 1.5bp withcolor blue dashed withdots scaled 0.5;
draw f_courbe(fx,fy,Pi,3*Pi,500)withpen pencircle scaled 1.5bp withcolor 0.8white dashed evenly scaled 0.5;
draw f_courbe(fx,fy,-5*Pi,-3*Pi,500)withpen pencircle scaled 1.5bp withcolor vert_e dashed evenly;
draw f_courbe(fx,fy,3*Pi,5*Pi,500)withpen pencircle scaled 1.5bp withcolor orange dashed withdots scaled 0.25;

dotlabel.urt(btex $\pi$ etex,r_p(Pi,0) );
 dotlabel.urt(btex $3\pi$ etex,r_p(3*Pi,0) );
dotlabel.urt(btex $-3\pi$ etex,r_p(-3*Pi,0) );
dotlabel.urt(btex $-\pi$ etex,r_p(-Pi,0) );
dotlabel.urt(btex $5\pi$ etex,r_p(5*Pi,0) );


drawarrow origin--r_p(1,0)withpen pencircle scaled 1.3bp;
drawarrow origin--r_p(0,1)withpen pencircle scaled 1.3bp;

label.lft(btex $\ve{j}$ etex,r_p(0,0.5) );

label.bot(btex $\ve{i}$ etex,r_p(0.5,0) );


drawarrow r_p(fx(Pi/4),fy(Pi/4))--r_p(fx(Pi/4+2*Pi),fy(Pi/4+2*Pi)) withcolor blue;
label.top(btex $2\pi\ve{i}$ etex, 0.5[r_p(fx(Pi/4),fy(Pi/4)),r_p(fx(Pi/4+2*Pi),fy(Pi/4+2*Pi))] ) withcolor blue;


drawarrow r_p(fx(-Pi/6),fy(-Pi/6))--r_p(fx(-Pi/6+2*Pi),fy(-Pi/6+2*Pi)) withcolor blue;
label.top(btex $2\pi\ve{i}$ etex, 0.5[r_p(fx(-Pi/6),fy(-Pi/6)),r_p(fx(-Pi/6+2*Pi),fy(-Pi/6+2*Pi))] ) withcolor blue;


drawarrow r_p(fx(-37*Pi/12),fy(-37*Pi/12))--r_p(fx(-37*Pi/12+2*Pi),fy(-37*Pi/12+2*Pi)) withcolor blue;
label.top(btex $2\pi\ve{i}$ etex, 0.5[r_p(fx(-37*Pi/12),fy(-37*Pi/12)),r_p(fx(-37*Pi/12+2*Pi),fy(-37*Pi/12+2*Pi))] ) withcolor blue;


drawarrow r_p(fx(-5*Pi/2),fy(-5*Pi/2))--r_p(fx(-5*Pi/2+2*Pi),fy(-5*Pi/2+2*Pi)) withcolor blue;
label.top(btex $2\pi\ve{i}$ etex, 0.5[r_p(fx(-5*Pi/2),fy(-5*Pi/2)),r_p(fx(-5*Pi/2+2*Pi),fy(-5*Pi/2+2*Pi))] ) withcolor blue;


fin;














end