Asymptote Generalities – fig1970

Category: Asymptote,Examples 2D,GeneralitiesPh. Ivaldi @ 2 h 39 min

Figure 0195
(Compiled with Asymptote version 2.14svn-r5318)
    
size(8cm,0);
import patterns;

add("hatchback",hatch(NW));
filldraw(xscale(2)*unitsquare,pattern("hatchback"));

add("r_hatchback",hatch(2.5mm,NW,.8red));
filldraw(shift(0,-2)*yscale(2)*unitsquare,pattern("r_hatchback"));

add("b_hatchback",hatch(NW,2.5mm+.8blue));
filldraw(shift(1,-2)*yscale(2)*unitsquare,pattern("b_hatchback"));

Étiquettes : , ,


Asymptote using graph.asy – fig0220

Category: Asymptote,Examples 2D,graph.asyPh. Ivaldi @ 23 h 10 min

Figure 0021
(Compiled with Asymptote version 2.14svn-r5318)
    
/*One can see this graphe drawed with my package HERE*/
import graph;
import patterns;
usepackage("mathrsfs");

unitsize(2cm,1.5cm);
real xmin=-1,xmax=4;
real ymin=-1,ymax=5;

// Definition of fonctions f and g :
real f(real x) {return 4x-x^2+4/(x^2+1)^2;}
real g(real x) {return x-1+4/(x^2+1)^2;}

// Trace the curves :
path Cf=graph(f,xmin,xmax,n=400);
path Cg=graph(g,xmin,xmax,n=400);
draw(Cf,linewidth(1bp));
draw(Cg,linewidth(1bp));
xlimits(xmin,xmax,Crop);
ylimits(ymin,ymax,Crop);

// The grid :
xaxis(BottomTop, xmin, xmax, Ticks("%", Step=1, step=0.5, extend=true, ptick=lightgrey));
yaxis(LeftRight, ymin, ymax, Ticks("%", Step=1, step=0.5, extend=true, ptick=lightgrey));
// The axis.
xequals(Label("$y$",align=W),0,ymin=ymin-0.25, ymax=ymax+0.25,
        Ticks(NoZero,pTick=nullpen, ptick=grey),
        p=linewidth(1pt), Arrow(2mm));
yequals(Label("$x$",align=S),0,xmin=xmin-0.25, xmax=xmax+0.25,
        Ticks(NoZero,pTick=nullpen, ptick=grey),
        p=linewidth(1pt), Arrow(2mm));

labelx(Label("$O$",NoFill), 0, SW);
draw(Label("$\vec{\imath}$",align=S,UnFill),
     (0,0)--(1,0),scale(2)*currentpen,Arrow);
draw(Label("$\vec{\jmath}$",align=W,UnFill),
     (0,0)--(0,1),scale(2)*currentpen,Arrow);
dot((0,0));

label("$\mathscr{C}_f$",(2.25,f(2.25)),2N);
label("$\mathscr{C}_f$",(2.25,g(2.25)),2S);

// Les hachures.
path vline=(1,-1)--(1,5);
add("hachure",hatch(3mm));
fill(buildcycle(vline,graph(f,1,4),graph(g,1,4)),pattern("hachure")); 

Étiquettes : , , , , ,


Unofficial package graph_pi.asy – fig0060

Category: Asymptote,graph_pi.asy,Unofficial packagesPh. Ivaldi @ 10 h 50 min

Figure 0006
(Compiled with Asymptote version 2.14svn-r5318)
    
import graph_pi;
import patterns;

graphicrules(xunit=2.5cm,yunit=1.5cm, xmin=-1, xmax=4, ymin=-1, ymax=5,
             crop=Crop);

// Définition des fonctions f et g :
real f(real x) {return 4x-x^2+4/(x^2+1)^2;}
real g(real x) {return x-1+4/(x^2+1)^2;}

// Tracé des courbes :
path Cf=graph(f,n=700);
path Cg=graph(g,n=700);
draw(Cf,linewidth(1bp));
draw(Cg,linewidth(1bp));
crop(currentpicture);

// La grille.
grid();
// Les axes.
cartesianaxis(xticks=Ticks(NoZero,ptick=grey),
              yticks=Ticks(NoZero,ptick=grey),arrow=None);
labeloij(UnFill);

label("$\mathscr{C}_f$",(2.25,f(2.25)),2N);
label("$\mathscr{C}_f$",(2.25,g(2.25)),2S);

// Les hachures.
path vline=(1,-1)--(1,5);
add("hachure",hatch(3mm));
fill(buildcycle(vline,graph(f,1,4),graph(g,1,4)),pattern("hachure"));

Étiquettes : , ,


Official Asymptote example – hatch

Category: Asymptote,Official Gallery One-PagerPh. Ivaldi @ 22 h 57 min

Figure 0086
(Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */
    
size(0,100);
import patterns;

add("hatch",hatch());
add("hatchback",hatch(NW));
add("crosshatch",crosshatch(3mm));

real s=1.25;
filldraw(unitsquare,pattern("hatch"));
filldraw(shift(s,0)*unitsquare,pattern("hatchback"));
filldraw(shift(2s,0)*unitsquare,pattern("crosshatch"));

Étiquettes : , ,


Official Asymptote example – shadedtiling

Category: Asymptote,Official Gallery One-PagerPh. Ivaldi @ 15 h 57 min

Figure 0195
(Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */
    
size(0,100);
import patterns;

real d=4mm;
picture tiling;
path square=scale(d)*unitsquare;
axialshade(tiling,square,white,(0,0),black,(d,d));
fill(tiling,shift(d,d)*square,blue);
add("shadedtiling",tiling);

filldraw(unitcircle,pattern("shadedtiling"));


Étiquettes : , , ,


Official Asymptote example – tile

Category: Asymptote,Official Gallery One-PagerPh. Ivaldi @ 2 h 57 min

Figure 0235
(Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */
    
size(0,90);
import patterns;

add("tile",tile());
add("filledtilewithmargin",tile(6mm,4mm,red,Fill),(1mm,1mm),(1mm,1mm));
add("checker",checker());
add("brick",brick());

real s=2.5;
filldraw(unitcircle,pattern("tile"));
filldraw(shift(s,0)*unitcircle,pattern("filledtilewithmargin"));
filldraw(shift(2s,0)*unitcircle,pattern("checker"));
filldraw(shift(3s,0)*unitcircle,pattern("brick"));

Étiquettes : , , ,