import graph_pi; import patterns; usepackage("mathrsfs"); size(10cm,0); graphicrules(xunit=1cm, yunit=1cm, xmin=-1, xmax=4, ymin=-3, ymax=3 //, crop=Crop ); // Définition et tracé de la grille grid(xStep=1, xstep=.5, yStep=1, ystep=.5, pTick=.7bp+.7white, ptick=.7bp+dotted+.7white, above=false ); // Définition et tracé des axes cartesianaxis( xticks=Ticks(Label(Fill(white)), Step=1, step=.5, NoZero, ptick=grey), yticks=Ticks(Label(Fill(white)), Step=2, step=1, NoZero, ptick=grey), Arrow ); // Définition des fonctions real f(real x) {return 2x-x^2;} real g(real x) {return x;} // Les hachures. path zonehachuree=buildcycle(graph(f,0,3),(3,-5)--(3,5),graph(g,3,0)); add("hachure",hatch(H=1mm,dir=SE,lightgray)); fill(zonehachuree,pattern("hachure")); // Tracé de courbe path Cf=graph(f,-1.5,4.5,n=400); path Cg=graph(g,-1.5,4.5,n=400); draw(Cf,1bp+blue); draw(Cg,dashed+1bp+red); xlimits(-1.5,4.5,Crop); ylimits(-3.5,3.5,Crop); label("$\mathscr{C}_f$",(2.5,f(2.5)),SW,blue); label("$\mathscr{C}_g$",(2.5,g(2.5)),NW,red); labeloij(p=1.4bp+.5*red, arrow=Arrow(SimpleHead,8bp), dot );