Asymptote Generalities – fig0640

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

Figure 0064
(Compiled with Asymptote version 2.14svn-r5318)
    
pair O=0;
labelmargin=2;

dot("N",O,N);
dot("S",O,S);
dot("E",O,E);
dot("W",O,W);

Étiquettes : , , , ,


Asymptote Generalities – fig0650

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

Figure 0065
(Compiled with Asymptote version 2.14svn-r5318)
    
size(4cm,0);

pair O=0;
dot("N",O,10N);
draw("S",O,10S);
draw("E",O,10E);
draw("W",O,10W);

draw("NE",O,5NE);
draw("SE",O,5SE);
draw("NW",O,5NW);
draw("SW",O,5SW);

Étiquettes : , , , ,


Asymptote Generalities – fig0660

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

Figure 0066
(Compiled with Asymptote version 2.14svn-r5318)
    
pair O=0;
draw(scale(2)*Label("N",.8red),O,10*N,linewidth(3mm));
draw(scale(2)*Label("S",.8red),O,10*S);
draw(scale(2)*Label("E",.8red),O,10*E);
draw(scale(2)*Label("W",.8red),O,10*W);

draw(rotate(45)*Label("NE"),O,5NE);
draw(rotate(-45)*Label("SE"),O,5SE);
draw(rotate(-45)*Label("NW"),O,5NW);
draw(rotate(45)*Label("SW"),O,5SW);

Étiquettes : , , , , ,


Asymptote Generalities – fig0890

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

Figure 0089
(Compiled with Asymptote version 2.14svn-r5318)
    
//From documentation of Asymptote
size(6cm,0); 

void distance(picture pic=currentpicture, pair A, pair B, Label L="", real n=0, pen p=currentpen) 
{
  real d=3mm;
  guide g=A--B;
  transform T=shift(-n*d*unit(B-A)*I);
  pic.add(new void(frame f, transform t) {
    picture opic;
    guide G=T*t*g;
    draw(opic,G,p,Arrows(NoFill),Bars,PenMargins); 
    label(opic,L,midpoint(G),UnFill(1)); 
    add(f,opic.fit());
  });
  pic.addBox(min(g),max(g),T*min(p),T*max(p));
} 
 
pair A=(0,0), B=(3,3);
 
dot(A); 
dot(B); 
distance(A,B,rotate(dir(A--B))*Label("$\ell$"),1); 

Étiquettes : , , , ,


Official Asymptote example – basealign

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

Figure 0008
(Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */
    
import fontsize;
import three;

settings.autobillboard=false;
settings.embed=false;
currentprojection=orthographic(Z);

defaultpen(fontsize(100pt));

dot(O);

label("acg",O,align=N,basealign);
label("ace",O,align=N,red);
label("acg",O,align=S,basealign);
label("ace",O,align=S,red);
label("acg",O,align=E,basealign);
label("ace",O,align=E,red);
label("acg",O,align=W,basealign);
label("ace",O,align=W,red);

picture pic;
dot(pic,(labelmargin(),0,0),blue);
dot(pic,(-labelmargin(),0,0),blue);
dot(pic,(0,labelmargin(),0),blue);
dot(pic,(0,-labelmargin(),0),blue);
add(pic,O);

dot((0,0));

label("acg",(0,0),align=N,basealign);
label("ace",(0,0),align=N,red);
label("acg",(0,0),align=S,basealign);
label("ace",(0,0),align=S,red);
label("acg",(0,0),align=E,basealign);
label("ace",(0,0),align=E,red);
label("acg",(0,0),align=W,basealign);
label("ace",(0,0),align=W,red);

picture pic;
dot(pic,(labelmargin(),0),blue);
dot(pic,(-labelmargin(),0),blue);
dot(pic,(0,labelmargin()),blue);
dot(pic,(0,-labelmargin()),blue);
add(pic,(0,0));

Étiquettes : , , , ,