## Asymptote Generalities – fig0010

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

 (Compiled with Asymptote version 2.14svn-r5318)

pair A, B, C, D;
A=(0,0);
B=(2,0);
C=(4,0);
D=(4,2);
draw(A--B);
draw(C--D);



Étiquettes : ,

## Asymptote Generalities – fig0020

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(1cm,0);
pair A, B, C, D;
A=(0,0);
B=(2,0);
C=(4,0);
D=(4,2);
draw(A--B);
draw(C--D);



Étiquettes : ,

## Asymptote Generalities – fig0030

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(3cm,0);
pair A, B, C, D;
A=(0,0);
B=(2,0);
C=(4,0);
D=(4,2);
draw(A--B);
draw(C--D);



Étiquettes : ,

## Asymptote Generalities – fig0040

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(1cm,0.5cm);
pair A, B, C, D;
A=(0,0);
B=(2,0);
C=(4,0);
D=(4,2);
draw(A--B);
draw(C--D);



Étiquettes : ,

## Asymptote Generalities – fig0050

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(3cm,0.5cm);
pair A, B, C, D;
A=(0,0);
B=(2,0);
C=(4,0);
D=(4,2);
draw(A--B);
draw(C--D);



Étiquettes : ,

## Asymptote Generalities – fig0060

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(3cm, 0.5cm, false);
pair A, B, C, D;
A=(0,0);
B=(2,0);
C=(4,0);
D=(4,2);
draw(A--B);
draw(C--D);



Étiquettes : ,

## Asymptote Generalities – fig0070

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(1cm, 3cm, false);
pair A, B, C, D;
A=(0,0);
B=(2,0);
C=(4,0);
D=(4,2);
draw(A--B);
draw(C--D);



Étiquettes : ,

## Asymptote Generalities – fig0080

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

 (Compiled with Asymptote version 2.14svn-r5318)

pair A, B, C, D;
A=(0,0);
B=(2cm,0);
C=(4cm,0);
D=(4cm,2cm);
draw(A--B);
draw(C--D);



Étiquettes : ,

## Asymptote Generalities – fig0090

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

 (Compiled with Asymptote version 2.14svn-r5318)

unitsize(1cm);
pair A, B, C, D;
A=(0,0);
B=(2,0);
C=(4,0);
D=(4,2);
draw(A--B);
draw(C--D);



Étiquettes : , ,

## Asymptote Generalities – fig0100

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

 (Compiled with Asymptote version 2.14svn-r5318)

unitsize(x=1cm, y=0.5cm);
pair A, B, C, D;
A=(0,0);
B=(2,0);
C=(4,0);
D=(4,2);
draw(A--B);
draw(C--D);



Étiquettes : , ,

## Asymptote Generalities – fig0110

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

draw(scale(4)*unitcircle);
dot((0,0));
dot((4,0));
fixedscaling((-8,-8),(6,6));
shipout(bbox(Fill(lightgrey)));



Étiquettes : , , ,

## Asymptote Generalities – fig0140

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(1cm,1cm);
pair A=(0,0), B=(1,0), C=(0,1);
draw (A--B--C);



Étiquettes : , ,

## Asymptote Generalities – fig0150

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(1cm,1cm);
pair A=(0,0), B=(1,0), C=(0,1);
draw (A--B--C--cycle);



Étiquettes : , ,

## Asymptote Generalities – fig0160

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(1cm,1cm);
pair [] A;
A[0]=(-1, -1);
A[1]=( 1, -1);
A[2]=( 1,  1);
A[3]=(-1,  1);
draw (A[0]--A[1]--A[2]--A[3]--cycle);
draw (A[0]--A[2]);
draw (A[1]--A[3]);



Étiquettes : , ,

## Asymptote Generalities – fig0170

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(2cm,2cm);
draw(unitsquare);
dot((0,0)--(1,1)--(0,1)--(1,0));
draw((0,0)--(1,1));
draw((1,0)--(0,1));



Étiquettes : , , ,

## Asymptote Generalities – fig0180

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,2cm,false);
draw(unitsquare);
dot((0,0)--(1,1)--(0,1)--(1,0));
draw((0,0)--(1,1));
draw((1,0)--(0,1));



Étiquettes : , , ,

## Asymptote Generalities – fig0190

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);
pair A,B,C;
A=(0,0);B=(1,0);C=(2,0);
draw(A,8bp+black);
draw(B,8bp+blue);
draw(C,linewidth(8bp));



Étiquettes : , ,

## Asymptote Generalities – fig0200

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

 (Compiled with Asymptote version 2.14svn-r5318)

unitsize(cm);
pair A=(0,0), B=(1,0), C=(0,1);
path trig;
trig=A--B--C--cycle;
draw(trig);
dot(trig,linewidth(4bp));
dot(shift(3,0)*trig,red+4bp);



Étiquettes : , , , , ,

## Asymptote Generalities – fig0210

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(2cm,2cm);
pair A, B, C;
A=(0,0); B=(1,0); C=(0,1);
draw(A--B--C--cycle);
draw (midpoint(A--B) -- C);
draw (B+0.5*(C-B) -- A);
draw (interp(A,C,0.5) -- B);



Étiquettes : , ,

## Asymptote Generalities – fig0220

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(2cm,2cm);
pair A, B, C;
A=(0,0); B=(1,0); C=(0,1);
draw(A--B--C--cycle);
draw (midpoint(A--B) -- C);
draw (B+0.5*(C-B) -- A);
draw (interp(A,C,0.5) -- B);
dot(A/3 + B/3 + C/3);



Étiquettes : , ,

## Asymptote Generalities – fig0230

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(2cm,0);
pair A=(0,0), B=(1,0), C=(0,1);
draw(A--B--C--cycle);
draw(A--B,linewidth(4bp));



Étiquettes : , ,

## Asymptote Generalities – fig0240

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(2cm,0);
pair A=(0,0), B=(1,0), C=(0,1);
draw(A--B--C--cycle);
draw(A--B,(red+green));



Étiquettes : , ,

## Asymptote Generalities – fig0250

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(2cm,0);
pair A=(0,0), B=(1,0), C=(0,1);

draw(A--B,.8white+6bp);
draw(A--C,.6white+6bp);
draw(B--C,.4white+6bp);

draw(A--B--C--cycle,yellow);



Étiquettes : , ,

## Asymptote Generalities – fig0260

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);

path p1=(0,0)--(1,1);
path p2=(2,0)--(3,1);

draw(p1,linewidth(5mm));
draw(p2,linewidth(5mm));
draw(p1--p2,3mm+.8blue);
draw(reverse(p1)--p2,1mm+.8red);



Étiquettes : , ,

## Asymptote Generalities – fig0270

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

pair A=(0,0), B=(1,0);

dot("$A$",A,N);
dot("$B$",B,N);
draw(interp(A,B,-.5)--interp(A,B,1.25));



Étiquettes : , , ,

## Asymptote Generalities – fig0280

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

 (Compiled with Asymptote version 2.14svn-r5318)

unitsize(cm);
path line=(0,0)--(6,0);

draw(line,solid);
draw(shift(0,-1)*line,dotted);
draw(shift(0,-2)*line,dashed);
draw(shift(0,-3)*line,longdashed);
draw(shift(0,-4)*line,dashdotted);
draw(shift(0,-5)*line,longdashdotted);



Étiquettes : ,

## Asymptote Generalities – fig0290

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

 (Compiled with Asymptote version 2.14svn-r5318)

unitsize(1cm);
path line=(0,0)--(6,0);
pen my_pen=linetype("24 8 8 8");

draw(line,linetype("24 8 8 8"));
draw(shift(0,-1)*line,my_pen+.8red);
draw(shift(0,-2)*line,my_pen+.7green+4bp);
draw(shift(0,-3)*line,linetype("24 8 8 8",false)+.7blue+4bp);
draw(shift(0,-4)*line,linetype("24 8 8 8",true,false)+4bp);
draw(shift(0,-5)*line,linetype("24 8 8 8",false,false)+.5red+blue+4bp);



Étiquettes : ,

## Asymptote Generalities – fig0300

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(8cm,0);

transform T=shift(0,-0.125);
path g=(0,0)--(1,0);
int i=-1;
draw(T^(++i)*g, Arrows());



Étiquettes : ,

## Asymptote Generalities – fig0310

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

 (Compiled with Asymptote version 2.14svn-r5318)

path line=(0,0)--(5cm,0);
draw(line,Arrow);
draw(shift(0,-cm)*line, BeginArrow);
draw(shift(0,-2cm)*line, MidArrow);
draw(shift(0,-3cm)*line, Arrows);

draw(shift(0,-4cm)*line, linewidth(3bp), Arrow(20bp));
draw(shift(0,-5cm)*line, linewidth(3bp), BeginArrow(20bp));
draw(shift(0,-6cm)*line, linewidth(3bp), MidArrow(20bp));
draw(shift(0,-7cm)*line, linewidth(3bp), Arrows(20bp));



Étiquettes : ,

## Asymptote Generalities – fig0320

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

 (Compiled with Asymptote version 2.14svn-r5318)

path line=(0,0)--(5cm,0);
draw(shift(6cm,0)*line,Arrow());
draw(shift(6cm,-cm)*line, BeginArrow());
draw(shift(6cm,-2cm)*line, MidArrow());
draw(shift(6cm,-3cm)*line, Arrows());

draw(shift(6cm,-4cm)*line, linewidth(3bp), Arrow(20bp));
draw(shift(6cm,-5cm)*line, linewidth(3bp), BeginArrow(20bp));
draw(shift(6cm,-6cm)*line, linewidth(3bp), MidArrow(20bp));
draw(shift(6cm,-7cm)*line, linewidth(3bp), Arrows(20bp));



Étiquettes : ,

## Asymptote Generalities – fig0330

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

 (Compiled with Asymptote version 2.14svn-r5318)

path line=(0,0)--(5cm,0);
draw(shift(6cm,0)*line,Arrow());
draw(shift(6cm,-cm)*line, BeginArrow());
draw(shift(6cm,-2cm)*line, MidArrow());
draw(shift(6cm,-3cm)*line, Arrows());

draw(shift(6cm,-4cm)*line, linewidth(3bp), Arrow(20bp));
draw(shift(6cm,-5cm)*line, linewidth(3bp), BeginArrow(20bp));
draw(shift(6cm,-6cm)*line, linewidth(3bp), MidArrow(20bp));
draw(shift(6cm,-7cm)*line, linewidth(3bp), Arrows(20bp));



Étiquettes : ,

## Asymptote Generalities – fig0340

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

 (Compiled with Asymptote version 2.14svn-r5318)

path line=(0,0)--(5cm,0);
draw(shift(6cm,0)*line,Arrow());
draw(shift(6cm,-cm)*line, BeginArrow());
draw(shift(6cm,-2cm)*line, MidArrow());
draw(shift(6cm,-3cm)*line, Arrows());

draw(shift(6cm,-4cm)*line, linewidth(bp), Arrow());
draw(shift(6cm,-5cm)*line, linewidth(2bp), BeginArrow(5bp));
draw(shift(6cm,-6cm)*line, linewidth(2bp), MidArrow(5bp));
draw(shift(6cm,-7cm)*line, linewidth(2bp), Arrows(5bp));



Étiquettes : ,

## Asymptote Generalities – fig0350

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

 (Compiled with Asymptote version 2.14svn-r5318)

path line=(0,0)..(2.5cm,2.5cm)..(5cm,0);
draw(line,ArcArrow);
draw(shift(0,-2cm)*line,BeginArcArrow);
draw(shift(0,-4cm)*line,MidArcArrow);
draw(shift(0,-6cm)*line,ArcArrows);

draw(shift(6cm,0)*line,3bp+.8red,ArcArrow(20bp));
draw(shift(6cm,-2cm)*line,3bp+.8red,BeginArcArrow(20bp));
draw(shift(6cm,-4cm)*line,3bp+.8red,MidArcArrow(20bp));
draw(shift(6cm,-6cm)*line,3bp+.8red,ArcArrows(20bp));



Étiquettes : ,

## Asymptote Generalities – fig0360

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

 (Compiled with Asymptote version 2.14svn-r5318)


path line=(0,0)..(2.5cm,2.5cm)..(5cm,0);
draw(line,ArcArrow());
draw(shift(0,-2cm)*line,BeginArcArrow());
draw(shift(0,-4cm)*line,MidArcArrow());
draw(shift(0,-6cm)*line,ArcArrows());

draw(shift(6cm,0)*line,3bp+.8red,ArcArrow(20bp));
draw(shift(6cm,-2cm)*line,3bp+.8red,BeginArcArrow(20bp));
draw(shift(6cm,-4cm)*line,3bp+.8red,MidArcArrow(20bp));
draw(shift(6cm,-6cm)*line,3bp+.8red,ArcArrows(20bp));



Étiquettes : ,

## Asymptote Generalities – fig0370

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

 (Compiled with Asymptote version 2.14svn-r5318)


path line=(0,0)..(2.5cm,2.5cm)..(5cm,0);
draw(line,ArcArrow());
draw(shift(0,-2cm)*line,BeginArcArrow());
draw(shift(0,-4cm)*line,MidArcArrow());
draw(shift(0,-6cm)*line,ArcArrows());

draw(shift(6cm,0)*line,3bp+.8red,ArcArrow(20bp));
draw(shift(6cm,-2cm)*line,3bp+.8red,BeginArcArrow(20bp));
draw(shift(6cm,-4cm)*line,3bp+.8red,MidArcArrow(20bp));
draw(shift(6cm,-6cm)*line,3bp+.8red,ArcArrows(20bp));



Étiquettes : ,

## Asymptote Generalities – fig0380

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

 (Compiled with Asymptote version 2.14svn-r5318)


path line=(0,0)..(2.5cm,2.5cm)..(5cm,0);
draw(line,Arrow());
draw(shift(0,-2cm)*line,BeginArrow());
draw(shift(0,-4cm)*line,MidArrow());
draw(shift(0,-6cm)*line,Arrows());

draw(shift(6cm,0)*line,3bp+.8red,Arrow(5bp));
draw(shift(6cm,-2cm)*line,3bp+.8red,BeginArrow(5bp));
draw(shift(6cm,-4cm)*line,3bp+.8red,MidArrow(5bp));
draw(shift(6cm,-6cm)*line,3bp+.8red,Arrows(5bp));



Étiquettes : ,

## Asymptote Generalities – fig0390

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

 (Compiled with Asymptote version 2.14svn-r5318)

path line=(0,0)--(5cm,0);

draw(line,Arrow(20bp,filltype=NoFill));
draw(shift(0,-cm)*line,Arrow(20bp,filltype=FillDraw(.8red)));
draw(shift(0,-2cm)*line,Arrow(20bp,filltype=Fill(.8red)));
draw(shift(0,-3cm)*line,Arrows(filltype=FillDraw(-10,10,.8red)));



Étiquettes : , ,

## Asymptote Generalities – fig0400

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

 (Compiled with Asymptote version 2.14svn-r5318)

path line=(0,0)--(5cm,0);

draw(line,Arrow(20bp,filltype=NoFill));
draw(shift(0,-cm)*line,Arrow(20bp,filltype=FillDraw(.8red)));
draw(shift(0,-2cm)*line,Arrow(20bp,filltype=Fill(.8red)));
draw(shift(0,-3cm)*line,Arrows(filltype=FillDraw(-10,10,.8red)));



Étiquettes : , ,

## Asymptote Generalities – fig0410

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

 (Compiled with Asymptote version 2.14svn-r5318)

path line=(0,0)--(5cm,0);

draw(line,Arrow(10bp,filltype=NoFill));
draw(shift(0,-2cm)*line,Arrow(10bp,filltype=FillDraw(.8red)));
draw(shift(0,-4cm)*line,Arrow(10bp,filltype=Fill(.8red)));
draw(shift(0,-6cm)*line,Arrows(filltype=FillDraw(-10,10,.8red)));



Étiquettes : , ,

## Asymptote Generalities – fig0420

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

 (Compiled with Asymptote version 2.14svn-r5318)

path line=(0,0)--(5cm,0);

draw(line,linewidth(5bp),Arrow);
draw(shift(0,-2cm)*line,linewidth(5bp),Arrow(30bp,10));
draw(shift(0,-5cm)*line,linewidth(30bp),Arrow(20bp,50));
draw(shift(0,-8cm)*line,linewidth(10bp),Arrow(20bp,50,filltype=NoFill));



Étiquettes : ,

## Asymptote Generalities – fig0430

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(5cm,0);
path line=(0,0)--(5,0);

draw(line,Arrow(20bp,position=.75));
draw(shift(0,-2)*line,Arrow(20bp,40,.75,filltype=NoFill));

position pos=BeginPoint;
pos.position=.75;
draw(shift(0,-4)*line,BeginArrow(20bp,pos));
draw(shift(0,-6)*line,BeginArrow(20bp,40,pos,filltype=NoFill));



Étiquettes : , , ,

## Asymptote Generalities – fig0460

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(5cm,0);
path line=(0,0)--(5,0);
transform T=shift(0,-1);

draw(line, Bar);
draw(T*line, BeginBar);
draw(T^2*line, Bars);
draw(T^3*line, Arrow, BeginBar);



Étiquettes : , ,

## Asymptote Generalities – fig0470

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

 (Compiled with Asymptote version 2.14svn-r5318)

path line=(0,0)--(5cm,0);
transform T=shift(0,-cm);

draw(line,linewidth(1mm),Bars);
draw(T^2*line,Bars(5mm));
draw(T^3*line,linewidth(1mm),Bars(5mm));
draw(T^4*line,dotted+red,Bars);



Étiquettes : , ,

## Asymptote Generalities – fig0480

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);

draw((-.5,0)--(1,0));
draw((0,-.5)--(0,1));
draw((0,0)--(.75,0),linewidth(1mm),Arrow(3mm));
draw((0,0)--(0,.75),linewidth(1mm),Arrow(3mm));



Étiquettes : ,

## Asymptote Generalities – fig0490

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

 (Compiled with Asymptote version 2.14svn-r5318)

fill((0,0)--(0,2cm)--(2cm,0)--cycle,gray);



Étiquettes : , ,

## Asymptote Generalities – fig0500

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

 (Compiled with Asymptote version 2.14svn-r5318)

filldraw((0,0)--(0,2cm)--(2cm,0)--cycle,gray);



Étiquettes : , ,

## Asymptote Generalities – fig0510

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

 (Compiled with Asymptote version 2.14svn-r5318)

filldraw((0,0)--(0,2cm)--(2cm,0)--cycle,fillpen=gray,drawpen=linewidth(1mm)+.8red);



Étiquettes : , ,

## Asymptote Generalities – fig0600

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(3cm,0);

pair A, B, C, D;
A=(0,0); B=(1,0);
C=(1,1); D=(0,1);
fill(A--C--B--D--cycle,grey);



Étiquettes : , ,

## Asymptote Generalities – fig0610

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(3cm,0);

pair A, B, C, D;
A=(0,0); B=(1,0);
C=(1,1); D=(0,1);
filldraw(A--C--B--D--cycle,grey);



Étiquettes : , ,

## Asymptote Generalities – fig0620

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(10cm,0);

path cle=unitcircle;

draw((-1.5,0)--(2.5,0),linewidth(10mm));
filldraw(cle,red+opacity(.5));
filldraw(shift((1,0))*cle,blue+opacity(.5));

shipout(format="pdf");
/*Others examples here.*/



Étiquettes : , , , ,

## Asymptote Generalities – fig0630

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

 (Compiled with Asymptote version 2.14svn-r5318)

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



Étiquettes : , , ,

## Asymptote Generalities – fig0640

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

 (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

 (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

 (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 – fig0670

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

 (Compiled with Asymptote version 2.14svn-r5318)

pair O=0;
dot(O);
label("$\frac{\pi^2}{2}$",O);



Étiquettes : , , , ,

## Asymptote Generalities – fig0680

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

 (Compiled with Asymptote version 2.14svn-r5318)

dot(Label("$\frac{\pi^2}{2}$",(0,0),align=E));



Étiquettes : , , , , ,

## Asymptote Generalities – fig0690

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

 (Compiled with Asymptote version 2.14svn-r5318)

label(scale(10)*Label("$\pi$"),(0,0));



Étiquettes : , ,

## Asymptote Generalities – fig0700

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

 (Compiled with Asymptote version 2.14svn-r5318)

texpreamble("\usepackage{manfnt}");

label(scale(3)*Label("\textdbend"),(0,0));



Étiquettes : , ,

## Asymptote Generalities – fig0710

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

 (Compiled with Asymptote version 2.14svn-r5318)

dot(Label("$A$"),(0,0),S);



Étiquettes : , , , ,

## Asymptote Generalities – fig0720

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,4cm);

dot(Label("$A$"),(0,0),S);
draw(E--W,invisible);
draw(N--S,invisible);
shipout(bbox());



Étiquettes : , , , ,

## Asymptote Generalities – fig0730

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

 (Compiled with Asymptote version 2.14svn-r5318)

dot(Label("$A$",fontsize(20pt)),(0,0),NE);



Étiquettes : , , , , ,

## Asymptote Generalities – fig0740

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

 (Compiled with Asymptote version 2.14svn-r5318)

defaultpen(fontsize(20pt));
dot(Label("$A$"),(0,0),NE);
dot(Label("$B$"),(2cm,0),NE+N);



Étiquettes : , , , , , ,

## Asymptote Generalities – fig0750

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

 (Compiled with Asymptote version 2.14svn-r5318)

label(rotate(45)*"\textbf{Hello}");



Étiquettes : , ,

## Asymptote Generalities – fig0780

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

 (Compiled with Asymptote version 2.14svn-r5318)

label(scale(4)*"\textbf{Cancel}");
draw((min(currentpicture).x,0)--(max(currentpicture).x,0), 2bp+yellow);



Étiquettes : , , ,

## Asymptote Generalities – fig0790

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

 (Compiled with Asymptote version 2.14svn-r5318)

label(scale(4)*"\textbf{Cancel}");
layer();
draw((min(currentpicture).x,0)--(max(currentpicture).x,0), 2bp+yellow);



Étiquettes : , , ,

## Asymptote Generalities – fig0800

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(3cm,0);
path line1=(0,0)--(1,0);
path line2=(0,0)--(1,1);
pair bissec=dir(line1,line2);

draw(line1); draw(line2);
dot(bissec,linewidth(3bp));
draw(-.5bissec--bissec,dotted);
dot("$A$",(0,0),-bissec);



Étiquettes : ,

## Asymptote Generalities – fig0810

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);
pair A=0, B=(1,0), C=(2,2);;

draw(A--B--C--cycle);
dot("$A$",A,dir(C--A,B--A));
dot("$B$",B,dir(C--B,A--B));
dot("$C$",C,dir(A--C,B--C));



Étiquettes : , ,

## Asymptote Generalities – fig0820

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);
path line=(0,0)--(3cm,0);
transform T=shift(0,-cm);

draw("$A$",line);
draw("$B$",T*line,dir(0));
draw("$C$",T^2*line,N);
draw(Label("$D$",fontsize(14pt)),T^3*line);



Étiquettes : , , , ,

## Asymptote Generalities – fig0830

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);
path line=(0,0)--(3cm,0);
transform T=shift(0,-cm);

draw(Label("A",align=Center,filltype=UnFill), line);
draw(Label("B",UnFill), T*line, Center);
draw(Label("C",align=Center,position=Relative(.75),UnFill), T^2*line);
draw(Label("D",position=Relative(.25),UnFill), align=Center, T^3*line);



Étiquettes : , , , , ,

## Asymptote Generalities – fig0840

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

 (Compiled with Asymptote version 2.14svn-r5318)

pair c=0;
label("abc xyz ijk",c,Align,basealign);
label("abc xyz ijk",c,Align,red);
draw(c--(c+(2cm,0))); // This is the baseline.

shipout((scale(3)*currentpicture.fit()));



Étiquettes : , , , ,

## Asymptote Generalities – fig0850

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(3cm,0);
pair A=0, B=(1,0), C=(1,1);

draw("$1$",A--B);
draw("$1$",B--C);
draw("$\sqrt{2}$",C--A);



Étiquettes : , , ,

## Asymptote Generalities – fig0860

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(3cm,0);
pair A=0, B=(1,0), C=(1,1);

draw("$1$",A--B);
draw("$1$",B--C);

// draw(rotate(dir(C--A))*"$\sqrt{2}$",C--A);
draw(Label("$\sqrt{2}$",Rotate(-dir(C--A))),C--A);



Étiquettes : , , , , , ,

## Asymptote Generalities – fig0870

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(3cm,0);
path g=(1,1)--(3,2);
draw(Label("a text",Rotate(dir(g))), g);
draw(Label("a text",red,Rotate(-dir(g)),align=I*dir(g)), g);



Étiquettes : , , , , ,

## Asymptote Generalities – fig0880

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);
pair A=(0,0), B=(4cm,0);
path line=A--B;
transform TD=shift(0,-cm);
transform TR=shift(2.5cm,0);

defaultpen(linewidth(3bp));

draw("$AB$",line,.8red,Arrows(3mm));
draw("$A$",A,N); draw("$B$",B,N);

draw("$AB$",TD*line,.8red,Arrows(3mm),PenMargins);
draw("$A$",TD*A,N); draw("$B$",TD*B,N);

draw("$AB$",TD^2*line,.8red,Arrows(3mm),DotMargins);
dot("$A$",TD^2*A,dotfactor*NW); dot("$B$",TD^2*B,dotfactor*NE);

margin BigMargins=Margin(2,2);
draw("$AB$",TD^3*line,.8red,Arrows(3mm),BigMargins);
draw("$A$",TD^3*A,N); draw("$B$",TD^3*B,N);



Étiquettes : , , , , ,

## Asymptote Generalities – fig0910

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);
pair A=0;
dot(A);
arrow("1",A,NE,2cm);
arrow("2",A,SE,1cm);
arrow("3",A,SW,1.5cm,Margin(3,0));
arrow("4",A,NW,1.5cm,N);



Étiquettes : , ,

## Asymptote Generalities – fig0920

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);

draw(E--N--W--S--cycle,.5red+1mm);

draw(E..N..W..S..cycle);
dot(E..N..W..S..cycle,red);



Étiquettes : , , ,

## Asymptote Generalities – fig0930

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);
pair O=0;

draw(circle(O,2cm));
dot(circle(O,2cm),red+4bp);



Étiquettes : , , , ,

## Asymptote Generalities – fig0940

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm);

draw(unitcircle, dot);
dotfactor*=3;
draw(shift(-0.5,-0.5)*unitsquare, dot(blue,Fill(red)));



Étiquettes : , , , ,

## Asymptote Generalities – fig0950

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

real R=2cm;

draw(scale(R)*unitcircle);
dot((0,0),linewidth(4bp));
dot((R*cos(pi/6),R*sin(pi/6)),red+8bp);



Étiquettes : , , , ,

## Asymptote Generalities – fig0960

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);

import graph;

path PerfectCircle=Circle((0,0),1);

draw(PerfectCircle,linewidth(2mm));
dot(PerfectCircle,.8red);



Étiquettes : , , ,

## Asymptote Generalities – fig0970

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);

//Return Circle AB diameter
path circle(pair A, pair B)
{
return shift(midpoint(A--B))*scale(abs(A-B)/2)*unitcircle;
}

pair A=(0,0), B=(1,0);

draw(circle(A,B));
dot(A--B);



Étiquettes : , , , ,

## Asymptote Generalities – fig0980

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

//Return Circle AB diameter
path circle(pair A, pair B)
{
return shift(midpoint(A--B))*scale(abs(A-B)/2)*unitcircle;
}

pair A=(0,0), B=(3,0), C=(2,1);

draw(A--B,.8blue);
draw(A--C,.8red);
draw(B--C,.8green);
draw(circle(A,B),.8blue);
draw(circle(A,C),.8red);
draw(circle(B,C),.8green);



Étiquettes : , , , ,

## Asymptote Generalities – fig0990

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);

//Return Circle AB diameter
path circle(pair A, pair B)
{
return shift(midpoint(A--B))*scale(abs(A-B)/2)*unitcircle;
}

pair A=(0,0), B=(1,0), C=(2,0);
path cleAB=circle(A,B);
path cleAC=circle(A,C);

for(real t=0; t<length(cleAB); t+=0.01)
fill(circle(point(cleAB,t),point(cleAC,t)));



Étiquettes : , , , , ,

## Asymptote Generalities – fig1000

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);
pair O=0;

defaultpen(linewidth(2mm));
draw(arc(O,2cm,0,60),.8red,BeginPenMargin);
draw(arc(O,2cm,60,120),.7green,PenMargins);
draw(arc(O,-2cm,0,120),.7blue);



Étiquettes : , , ,

## Asymptote Generalities – fig1020

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);

real a=360/6;
for (int i = -1; i < 5; ++i)
fill(arc((0,0),1,i*a,(i+1)*a)--cycle,grey);



Étiquettes : , , ,

## Asymptote Generalities – fig1030

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);

real n=7, a=360/n;
for (int i = 0; i < n; ++i)
filldraw((0,0)--arc((0,0),1,i*a,(i+1)*a)--cycle, i/n*blue + (1-i/n)*green + grey);



Étiquettes : , , , ,

## Asymptote Generalities – fig1040

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);

real a=360/6;
for (int i = -1; i < 5; ++i)
draw(Label(format("%i",i+1)),arc((0,0),10,i*a,(i+1)*a)--cycle,grey);



Étiquettes : , , , , , , ,

## Asymptote Generalities – fig1050

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair x=0;
pair y=(-6.5cm,0);

label(format(6.66666), x, E);
label("format(6.66666)", y, E);

x+=(0,-1cm);y+=(0,-1cm);
label(format("$x=%f$", 6.66666), x, E);
label("format(\"\$x=\%f\$\", 6.66666)", y, E);

x+=(0,-1cm);y+=(0,-1cm);
label(format("$x=%.1f$", 6.66666), x, E);
label("format(\"\$x=\%.1f\$\", 6.66666)", y, E);

x+=(0,-1cm);y+=(0,-1cm);
label(format("$x=%.2f$", 6.66666), x, E);
label("format(\"\$x=\%.2f\$\", 6.66666)", y, E);

x+=(0,-1cm);y+=(0,-1cm);
label(format("$x=%.0f$", 6.66666), x, E);
label("format(\"\$x=\%.0f\$\", 6.6666)", y, E);

x+=(0,-1cm);y+=(0,-1cm);
label(format("$x=%07.3f$", 6.66666), x, E);
label("format(\"\$x=\%07.3f\$\", 6.6666)", y, E);

x+=(0,-1cm);y+=(0,-1cm);
label(format("$x=%7.3f$", 6.66666), x, E);
label("format(\"\$x=\% 7.3f\$\", 6.6666)", y, E);

x+=(0,-1cm);y+=(0,-1cm);
label(format("$x=%g$", 66.666), x, E);
label("format(\"\$x=\%g\$\", 66.66666)", y, E);

x+=(0,-1cm);y+=(0,-1cm);
label(format("$x=%g$", 666666.666), x, E);
label("format(\"\$x=\%g\$\", 666666.666)", y, E);

x+=(0,-1cm);y+=(0,-1cm);
label(format("$x=%g$", 666666666.666), x, E);
label("format(\"\$x=\%g\$\", 666666666.666)", y, E);

x+=(0,-1cm);y+=(0,-1cm);
label(format("$x=%e$", 666666.666), x, E);
label("format(\"\$x=\%e\$\", 666666.666)", y, E);

x+=(0,-1cm);y+=(0,-1cm);
label(format("$x=%.2e$", 666666.666), x, E);
label("format(\"\$x=\%.2e\$\", 666666.666)", y, E);

x+=(0,-1cm);y+=(0,-1cm);
label(format("$x=%i$", 6), x, E);
label("format(\"\$x=\%i\$\", 6)", y, E);

x+=(0,-1cm);y+=(0,-1cm);
label(format("$x=%f$", 6.0), x, E);
label("format(\"\$x=\%f\$\", 6.0)", y, E);

x+=(0,-1cm);y+=(0,-1cm);
label(format("$x=%+.2f$", 6.66666), x, E);
label("format(\"\$x=\%+.2f\$\", 6.66666)", y, E);

x+=(0,-1cm);y+=(0,-1cm);
label(format("$x=%+.2f$", -6.66666), x, E);
label("format(\"\$x=\%+.2f\$\", -6.66666)", y, E);

x+=(0,-1cm);y+=(0,-1cm);
label(format("$x=% .2f$", 6.666666), x, E);
label("format(\"\$x=\% .2f\$\", 6.666666)", y, E);



Étiquettes : ,

## Asymptote Generalities – fig1070

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

 (Compiled with Asymptote version 2.14svn-r5318)

// This file was compiled with this unix command: LC_NUMERIC="french" asy
size(0,0);
texpreamble("\usepackage[frenchb]{babel}");

pair x=0;

x+=(0,-1cm);
label(format("$x=%f$", 666666.666), x, E);
x+=(0,-1cm);
label(format("$x=%f$", pi), x, E);
x+=(0,-1cm);
label(format("$x=\nombre{%f}$", 666666.666), x, E);
x+=(0,-1cm);
label(format("$x=\nombre{%f}$", pi), x, E);



Étiquettes : ,

## Asymptote Generalities – fig1100

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);
pair A, B, C;
A=(0,0); B=(3cm,0); C=(0,3cm);

draw(A--B--C--cycle);
filldraw(shift(A)*scale(4bp)*unitcircle, white);
filldraw(shift(B)*scale(4bp)*unitcircle, white);
filldraw(shift(C)*scale(4bp)*unitcircle, white);



Étiquettes : , ,

## Asymptote Generalities – fig1110

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);
pair A=(0,0), B=(0,1), C=(1,0), D=(1,1);

draw(A..B..C..D);
dot(A);dot(B);dot(C);dot(D);



Étiquettes : , ,

## Asymptote Generalities – fig1120

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);
import roundedpath;

pair A=(0,0), B=(0,1), C=(1,0), D=(1,1);

draw(roundedpath(A--B--C--D,.5));
dot(A--B--C--D);



Étiquettes : , ,

## Asymptote Generalities – fig1130

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);
pair A=(0,0), B=(0,1), C=(1,0), D=(1,1);

draw(A--B..C..D);
dot(A--B--C--D);



Étiquettes : , ,

## Asymptote Generalities – fig1140

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);
pair A=(0,0), B=(0,1), C=(1,0), D=(1,1);

draw(A..B..C..D--cycle);
dot(A);dot(B);dot(C);dot(D);



Étiquettes : , ,

## Asymptote Generalities – fig1150

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);
pair A=(0,0), B=(0,1), C=(1,0), D=(1,1);

draw(A---B..C..D);
dot(A);dot(B);dot(C);dot(D);



Étiquettes : , ,

## Asymptote Generalities – fig1160

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);
import roundedpath;

draw(roundedpath(unitsquare,.4));
dot(roundedpath(unitsquare,.4),red);
draw(unitsquare);
dot(unitsquare);



Étiquettes : , ,

## Asymptote Generalities – fig1170

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair A=0, B=(4cm,0);

draw(A{N}..B);
dot(A{N}..B);



Étiquettes : , ,

## Asymptote Generalities – fig1180

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair A=0, B=(4cm,0);

draw(A{N}..B{E});
dot(A{N}..B{E});



Étiquettes : , ,

## Asymptote Generalities – fig1190

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair A=0, B=(4cm,0);

draw(A{dir(90)}..B{dir(0)});
dot(A{dir(90)}..B{dir(0)});



Étiquettes : ,

## Asymptote Generalities – fig1200

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair A=0, B=(4cm,0);

draw(A{dir(90)}..B{dir(180)});
dot(A{dir(90)}..B{dir(180)});



Étiquettes : ,

## Asymptote Generalities – fig1210

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair A=0, B=(4cm,0);

draw(A{N}..B{N});
dot(A{N}..B{N});



Étiquettes : ,

## Asymptote Generalities – fig1220

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair A=0, B=(4cm,0);

draw(A{N}..B{N}..cycle);
dot(A{N}..B{N}..cycle);



Étiquettes : ,

## Asymptote Generalities – fig1230

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

 (Compiled with Asymptote version 2.14svn-r5318)

//From documentation of Asymptote
size(0,6cm);
guide center = (0,1){W}..tension 0.8..(0,0){(1,-.5)}..tension 0.8..{W}(0,-1);

draw((0,1)..(-1,0)..(0,-1));
filldraw(center{E}..{N}(1,0)..{W}cycle);
unfill(circle((0,0.5),0.125));
fill(circle((0,-0.5),0.125));



Étiquettes : , , ,

## Asymptote Generalities – fig1250

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair A=0, B=(2cm,2cm), C=(4cm,0);

draw(A..B..C);
draw(A{curl 0}..B..{curl 0}C,red);
dot(A--B--C);



Étiquettes : ,

## Asymptote Generalities – fig1260

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair A=0, B=(2cm,2cm), C=(4cm,0);

draw(A..B..C,linewidth(3mm));
draw(A{curl 1}..B..{curl 1}C,2mm+.8red);
dot(A--B--C);



Étiquettes : ,

## Asymptote Generalities – fig1270

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair A=0, B=(3cm,4cm), C=(6cm,0);

draw(A..B..C);
draw(A{curl 0}..B..{curl 0}C,1mm+red+grey);
draw(A{curl 5}..B..{curl 0}C,1mm+green+grey);
draw(A{curl 10}..B..{curl 0}C,1mm+blue+grey);
draw(A{curl 10}..B..{curl 10}C,1mm+yellow+grey);
dot(A--B--C);



Étiquettes : ,

## Asymptote Generalities – fig1280

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair A=0, B=(3cm,0.5cm), C=(6cm,0);

draw(A{N}..B{E}..C{S});
draw(A{N}::B{E}::C{S},red);
dot(A--B--C);



Étiquettes : ,

## Asymptote Generalities – fig1290

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair A=0, B=(3cm,5cm), C=(6cm,0);
defaultpen(1mm);

draw(A..B..C);
draw(A.. tension .75 ..B.. tension .75 ..C,grey);
draw(A.. tension 1.5 ..B.. tension 1.5 ..C,.8red);
draw(A.. tension 2 ..B.. tension 2 ..C,green+grey);
draw(A.. tension 10 ..B.. tension 10 ..C,blue+grey);
dot(A--B--C,linewidth(6bp));



Étiquettes : ,

## Asymptote Generalities – fig1300

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair A=0, B=(3cm,5cm), C=(6cm,0);
defaultpen(1mm);

draw(A..B..C);
draw(A.. tension 10 and 1 ..B.. tension 1 and 10 ..C,grey);
draw(A.. tension 1 and 10 ..B.. tension 10 and 1 ..C,.8red);
draw(A.. tension 2 and 1 ..B.. tension 1 and 2 ..C,blue+grey);
dot(A--B--C,linewidth(6bp));



Étiquettes : ,

## Asymptote Generalities – fig1310

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair A=0, B=(3cm,5cm), C=(6cm,0);
defaultpen(1mm);

draw(A..B..C);
draw(A.. tension 5 and 3 ..B.. tension 1 and 5 ..C,grey);
draw(A.. tension 5 and 1 ..B.. tension 3 and 5 ..C,.8red);
dot(A--B--C,linewidth(6bp));



Étiquettes : ,

## Asymptote Generalities – fig1320

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair A=0, B=(3cm,5cm), C=(6cm,0);

pair ctrl_rgt_A, ctrl_lft_B, ctrl_rgt_B, ctrl_lft_C;
ctrl_rgt_A=A+2cm*E;
ctrl_lft_B=B+3cm*W;
ctrl_rgt_B=B+3cm*E;
ctrl_lft_C=C+2cm*W;

draw(A..B..C);
draw(A.. controls ctrl_rgt_A and ctrl_lft_B ..B.. controls ctrl_rgt_B and ctrl_lft_C ..C,1mm+grey);
dot(A--B--C,linewidth(6bp));
draw((A--ctrl_rgt_A),Arrow, p=grey);
draw((B--ctrl_rgt_B),Arrow, p=grey);
draw((B--ctrl_lft_B),Arrow, p=grey);
draw((C--ctrl_lft_C),Arrow, p=grey);



Étiquettes : , ,

## Asymptote Generalities – fig1330

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair A=0, B=(3cm,5cm), C=(6cm,0);

pair ctrl_rgt_A, ctrl_lft_B, ctrl_rgt_B, ctrl_lft_C;
ctrl_rgt_A=A+2cm*NE;
ctrl_lft_B=B+5cm*SW;
ctrl_rgt_B=B+2cm*SE;
ctrl_lft_C=C+5cm*NW;

draw(A..B..C);
draw(A.. controls ctrl_rgt_A and ctrl_lft_B ..B.. controls ctrl_rgt_B and ctrl_lft_C ..C,1mm+grey);
dot(A--B--C,linewidth(6bp));
draw((A--ctrl_rgt_A),Arrow, p=grey);
draw((B--ctrl_rgt_B),Arrow, p=grey);
draw((B--ctrl_lft_B),Arrow, p=grey);
draw((C--ctrl_lft_C),Arrow, p=grey);



Étiquettes : , ,

## Asymptote Generalities – fig1340

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(8cm);
path p1 = (0,0){up}..(5,4)..(10,0){down};

pair post0=postcontrol(p1,0);
pair pre1=precontrol(p1,1);
pair post1=postcontrol(p1,1);
pair pre2=precontrol(p1,2);

dot(post0^^pre1^^post1^^pre2);
path p2 = (0,0)..controls post0 and pre1..(5,4)..controls post1 and pre2..(10,0);

draw(p1,2mm+red);
draw(p2,linewidth(1mm));



Étiquettes : , ,

## Asymptote Generalities – fig1350

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

path pt1=scale(2cm)*unitcircle;
path pt2=scale(1cm)*unitcircle;

draw(pt1^^pt2);
dot(pt1^^pt2);



Étiquettes : , , ,

## Asymptote Generalities – fig1360

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

path cle=scale(2cm)*unitcircle;

draw(cle);

for(real i=0; i<=length(cle); i+=.2)
{
dot(point(cle,i));
draw((0,0)--point(cle,i),dotted);
}



Étiquettes : , , , , ,

## Asymptote Generalities – fig1370

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

path cle=scale(2cm)*unitcircle;

draw(cle);

for(real i=0; i<=length(cle); i+=.2)
draw(point(cle,i)--2cm*dir(cle,i)+point(cle,i),Arrow,p=i/length(cle)*red);



Étiquettes : , , , , ,

## Asymptote Generalities – fig1380

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

path cle=scale(2cm)*reverse(unitcircle);

draw(cle);

for(real i=0; i<=length(cle); i+=.2)
draw(point(cle,i)--2cm*dir(cle,i)+point(cle,i),Arrow,p=i/length(cle)*red);



Étiquettes : , , , , ,

## Asymptote Generalities – fig1390

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(8cm,0);
pair O=(0,0);
path p=(0,0){dir(0)}..{dir(45)}(2,2){dir(-45)}..{dir(0)}(4,0);

pair En1=dir(p, 1, -1);
pair En2=dir(p, 2, -1);
draw(p);
draw(Label("dir(p,1,-1)", EndPoint), point(p,1)--point(p,1)+En1, red, Arrow);
draw(Label("dir(p,2,-1)", EndPoint), point(p,2)--point(p,2)+En2, red, Arrow);

pair Ep0=dir(p, 0, 1);
pair Ep1=dir(p, 1, 1);
draw(Label("dir(p,0,1)", EndPoint), point(p,0)--point(p,0)+Ep0, blue, Arrow);
draw(Label("dir(p,1,1)", EndPoint, E), point(p,1)--point(p,1)+Ep1, blue, Arrow);

draw(p, dot);



Étiquettes : , , ,

## Asymptote Generalities – fig1400

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

path cle=scale(2cm)*reverse(unitcircle);

draw(cle);

for(real i=0; i<=length(cle); i+=.2)
draw(point(cle,i)--(1cm*I*dir(cle,i))+point(cle,i),Arrow,p=i/length(cle)*red);



Étiquettes : , , , ,

## Asymptote Generalities – fig1420

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

path curv=reverse((0,2){dir(-60)}..(1,0)..{dir(60)}(2,2));

draw(curv);

for(real i=0; i<=length(curv); i+=.1)
draw(point(curv,i)--dir(curv,i)+point(curv,i),grey);



Étiquettes : , , , ,

## Asymptote Generalities – fig1430

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(10cm,0);

path curv=reverse((0,2){dir(10)}..(1,0)..{dir(-50)}(3,2));
guide dirc;

draw(curv,linewidth(1mm)+grey);

for(real i=0; i<=length(curv); i+=.005)
{
draw(point(curv,i)--dir(curv,i)+point(curv,i),grey+yellow);
dirc=dirc..dir(curv,i)+point(curv,i);
}

draw(dirc,grey);



Étiquettes : , , ,

## Asymptote Generalities – fig1440

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

 (Compiled with Asymptote version 2.14svn-r5318)

// Author: John Bowman
pair[] z=new pair[10];
z[0]=(0,100); z[1]=(50,0); z[2]=(180,0);
for(int n=3; n <= 9; ++n)
z[n]=z[n-3]+(200,0);
path p=z[0]..z[1]---z[2]---z[3]
&z[3]..z[4]--z[5]::{up}z[6]
&z[6]::z[7]---z[8]..{up}z[9];
defaultpen(linewidth(1));
draw(p, grey);
dot(p);

real len=50;
for(int i = 0; i < z.length; ++i) {
pair z=point(p,i);
draw(z--z+len*dir(p,i,-1),red);
draw(z--z+len*dir(p,i,1),blue+dashed);
draw(z-len*dir(p,i)--z+len*dir(p,i),green+Dotted(defaultpen()));
}



Étiquettes : , ,

## Asymptote Generalities – fig1450

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(10cm,0);
import math;

path cle=unitcircle;
path curv=reverse((1.5,2){dir(-60)}..(2.5,0)..{dir(60)}(3.5,2));

draw(cle);
draw(curv);

pair pt_cle=point(cle, 1.35);
pair pt_dir_cle=dir(cle, 1.35);

drawline((pt_cle - pt_dir_cle), (pt_cle + pt_dir_cle), red);

pair pt_curv=point(curv, dirtime(curv, pt_dir_cle));

drawline((pt_curv - pt_dir_cle), (pt_curv + pt_dir_cle), blue);



Étiquettes : , , ,

## Asymptote Generalities – fig1460

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

pair O=(2cm,2cm);
path cle=shift(O)*scale(2cm)*unitcircle;
pair M=point(cle,.6);

dot("$O$",O,SW);
dot("$M$",M,unit(M-O));

draw(cle);
draw((0,0)--(0,4cm),Arrow);
draw((0,0)--(4cm,0),Arrow);

draw(Label("$X_M$",position=EndPoint),M--(xpart(M),0),dotted);
draw(Label("$Y_M$",position=EndPoint),M--(0,ypart(M)),dotted);



Étiquettes : , , , , ,

## Asymptote Generalities – fig1470

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

path p= scale(1cm)*unitcircle;

draw(p,red+1mm);
draw(shift(1mm,2mm)*p);
draw(shift(2*(1mm,2mm))*p);
draw(shift(3*(1mm,2mm))*p);
draw(shift(4*(1mm,2mm))*p);
draw(shift(5*(1mm,2mm))*p);



Étiquettes : , ,

## Asymptote Generalities – fig1480

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

path p= (5mm,-5mm){right} .. (2cm,0);

for(int i=10; i<360; i+=10)
draw(rotate(i)*p);

draw(p,red+1mm);



Étiquettes : , , ,

## Asymptote Generalities – fig1490

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);

path p= (1,-1){right} .. (4,0);
pair O=(3,.25);

for(int i=10; i<360; i+=10)
draw(rotate(i,O)*p);

dot(O,blue);
draw(p,red+1mm);



Étiquettes : , , ,

## Asymptote Generalities – fig1500

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

path curv=(0,0)..(1,1)..(1.5,-1)..(3,0);
pair A=(0,-1), B=(3,.75);

defaultpen(1mm);
draw(curv);
draw(reflect(A,B)*curv,.8red);
draw(A--B,grey);



Étiquettes : , ,

## Asymptote Generalities – fig1510

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);

path cle=unitcircle;

draw(cle,red);
draw(xscale(2)*cle);
draw(yscale(2)*cle);
draw(scale(2)*cle,blue);



Étiquettes : , , ,

## Asymptote Generalities – fig1520

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(8cm,0);

transform scale(pair center, real k)
{
return shift(center)*scale(k)*shift(-center);
}

path cle=unitcircle;
pair A=(4,0);
draw(cle);

draw(scale(A,.5)*cle,red);
draw(scale(A,-.75)*cle,blue);

for (real t; t<length(cle); t+=1)
draw(point(cle,t)--point(scale(A,-.75)*cle,t),dotted);

dot("$A$",A,N);



Étiquettes : , , , ,

## Asymptote Generalities – fig1540

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(10cm,0);

path unitpolygon(int n)
{
guide opath;
for (int i=1; i<=n; ++i)
opath=opath--rotate((i-1)*360/n)*E;
return opath--cycle;
}

for (int i=3; i<9; ++i)
draw(shift(2.5*(i%3),-2.5*quotient(i,3))*unitpolygon(i));



Étiquettes : , , ,

## Asymptote Generalities – fig1580

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

label(graphic("dali.eps","width=5cm"));
layer();

draw(scale(2cm)*unitcircle,linewidth(.75mm));
shipout(bbox(.25cm,Fill));



Étiquettes : , , , ,

## Asymptote Generalities – fig1590

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

label(graphic("dali.eps","width=5cm, bb=60 60 235 205, clip=true"));
shipout(bbox(.25cm,Fill));



Étiquettes : , , ,

## Asymptote Generalities – fig1600

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,4cm);

texpreamble("\usepackage{amsmath}
\DeclareMathOperator{\e}{e}");

pair A=2*expi(pi/3);

draw((0,-2)--(0,2.5));
draw((0,0)--(1,0),linewidth(1mm),Arrow(2mm));
draw((0,0)--(3.5,0));
draw((0,0)--(0,1),linewidth(1mm),Arrow(2mm));

dot(Label("$A(z_a=2\e^{i\frac{\pi}{3}})$"),A,NE);
label(format("$\vert z_a\vert=%.1f$",length(A)),(.5,-1),E);
label(format("$\arg(z_a)\simeq%.4f$",angle(A)),(.5,-2),E);



Étiquettes : , , , ,

## Asymptote Generalities – fig1610

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(10cm,0);

texpreamble("\usepackage{amsmath}
\DeclareMathOperator{\e}{e}");

pair A=2*expi(pi/3);
pair B=expi(pi/6);
pair C=A*B;
pair D=C-B;
pair Bp=2*B;
pair E=I*D;

draw((0,-2)--(0,2.5));
draw((0,0)--(1,0),linewidth(1mm),Arrow(2mm));
draw((-3,0)--(3.5,0));
draw((0,0)--(0,1),linewidth(1mm),Arrow(2mm));

dot(Label("$A(z_a=2\e^{i\frac{\pi}{3}})$"),A);
dot(Label("$B(z_a=\e^{i\frac{\pi}{6}})$"),B);
dot(Label("$B'(z_{b'}=2z_b)$"),Bp);
dot(Label("$\overline{A}(\overline{z_a})$"),conj(A));
dot(Label("$C(z_c=z_a z_c)$"),C,NE);
dot(Label("$D(z_d=z_c-z_d)$"),D,NW);
dot(Label("$E(z_e=iz_d)$"),E,NW);



Étiquettes : , , , ,

## Asymptote Generalities – fig1620

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

pair A=2expi(pi/2);

pair homography(pair z)
{
return (z^2+A)/(z+2);
}

guide image;
pair tpt;

draw(unitcircle);
for(real t=0; t<length(unitcircle);t+=.05)
{
tpt=homography(point(unitcircle,t));
image=image..tpt;
draw(point(unitcircle,t)--tpt,dotted);
}
draw(image..cycle,red);



Étiquettes : , , , ,

## Asymptote Generalities – fig1630

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(4cm,0);

path apath=(0,0)..(1,1)..(2,-1){dir(-90)};

draw(apath);

dot(apath);
dot(point(apath,length(apath)),.8green+8pt);
draw(point(apath,0)--point(apath,1)--point(apath,2),.8red);
draw(point(apath,0.5)--point(apath,1.5)--point(apath,2.5),.8blue);



Étiquettes : ,

## Asymptote Generalities – fig1640

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

path apath=(0,0)..(1,1)..(2,.5){dir(0)};

draw(subpath(apath,0,length(apath)/2),1pt+.8red,EndPenMargin);
draw(subpath(apath,length(apath)/2,length(apath)),1pt+.8blue,BeginPenMargin);



Étiquettes : , ,

## Asymptote Generalities – fig1650

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(10cm,0);
texpreamble("\usepackage{amsmath}");

path p = (0,0)..(1,1)..(2,.5){dir(0)};
real al    = arclength(p);
real l     = length(p);
pair pt    = point(p,l/2);
pair apt   = arcpoint(p,al/2);

draw(p);
draw(subpath(p,0,arctime(p,al/2)),blue);
dot(pt,red);
dot(apt,blue);

arrow("$\frac{\text{lenght(p)}}{2}$",pt,SSE,1cm);
arrow("$\frac{\text{arclenght(p)}}{2}$",apt,SSW,1cm);
label("\small The sizes of the blue path and the black path are equal",(1,.25));



Étiquettes : , ,

## Asymptote Generalities – fig1660

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(10cm,0);

path apath=(0,0)..(1,1)..(2,.5){dir(0)};
real l=length(apath);
real step=l/15;

for(real i=0; i<l-step; i+=step)
draw(subpath(apath,i,i+step),4bp+(i/l*red+(l-i)/l*blue),PenMargins);
draw(apath);



Étiquettes : , , ,

## Asymptote Generalities – fig1670

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(10cm,0);

path apath=(0,0)..(1,1)..(2,.5){dir(0)};
real l=arclength(apath);
real step=l/15;

path arcpath(path apath, real t1, real t2)
{
return subpath(apath, arctime(apath,t1), arctime(apath,t2));
}

for(real i=0; i<l-step; i+=step)
draw(arcpath(apath,i,i+step),4bp+(i/l*red+(l-i)/l*blue),PenMargins);
draw(apath);



Étiquettes : , , , ,

## Asymptote Generalities – fig1690

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

 (Compiled with Asymptote version 2.14svn-r5318)

import labelpath;

unitsize(5cm);
string text="\Huge A text along a curve";
path p=(0,0)..(1,1)..(2,0.5){dir(0)};

labelpath(text,p);
draw(p, lightgrey);



Étiquettes : , , , ,

## Asymptote Generalities – fig1700

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

path pth1=(0,-0.5)--(2,1);
path pth2=(0,0.5)--(2,-1);

draw(pth1^^pth2);

dot(intersectionpoint(pth1,pth2),red);



Étiquettes : , ,

## Asymptote Generalities – fig1710

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

path p = (0,0){up} .. (2cm,0){up};
path q = (0,1cm){dir(-60)}..(1cm,-1cm)..{dir(60)}(2cm,1cm);

draw(p^^q);
dot(intersectionpoint(p,q) , red);
dot(intersectionpoint(p,reverse(q)) , blue);



Étiquettes : , ,

## Asymptote Generalities – fig1720

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);
import math;

pair A=(0,-.5), B=A+dir(45);
pair C=(0,1), D=C+5dir(20);

pair I=extension(A,B,C,D);

path AB=A--B;
path CD=C--D;

draw(AB^^CD);
dot("$I$",I,N,red);
draw(B--I,1pt+dotted);
dot("$A$",A,SE);
dot("$B$",B,SE);
dot("$C$",C,N);
dot("$D$",D,N);



Étiquettes : , ,

## Asymptote Generalities – fig1730

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);
import math;

pair A=(0,-.5), B=A+dir(45);
pair C=(0,1)+2dir(20);
path cle=shift(C)*scale(1)*unitcircle;

pair I1=intersectionpoint(A--interp(A,B,2),cle);
pair I2=intersectionpoint(A--interp(A,B,10),cle);

path AB=A--B;

draw(AB^^cle);
dot(I1^^I2,red);
draw(B--I2,1pt+dotted);



Étiquettes : , ,

## Asymptote Generalities – fig1740

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

path Line(pair A, pair B)
{
return interp(A,B,-100000/arclength(A--B))--interp(A,B,100000/arclength(A--B));
}

path Parallel(pair A, pair dir)
{
return Line(A,A+dir);
}

pair A=0, B=(1,0), C=(.7,.7);
draw(A--B, .8red);
draw(A--C, .8green);
draw(B--C, .8blue);

label("$A$",A,SW);
label("$B$",B,SE);
label("$C$",C,N);

pair Ap=intersectionpoint(Parallel(B, A-C), Parallel(C, A-B));
pair Bp=intersectionpoint(Parallel(A, B-C), Parallel(C, A-B));
pair Cp=intersectionpoint(Parallel(A, B-C), Parallel(B, A-C));

draw(Ap--Bp, .8red);
draw(Ap--Cp, .8green);
draw(Bp--Cp, .8blue);

label("$A'$",Ap,NE);
label("$B'$",Bp,NW);
label("$C'$",Cp,S);



Étiquettes : , ,

## Asymptote Generalities – fig1750

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

path p = (0,0){up} .. (2cm,0){up};
path q = (0,1cm){dir(-60)}..(1cm,-1cm)..{dir(60)}(2cm,1cm);

draw(p, red);
draw(q, blue);
dot(intersectionpoint(p,q));
draw(point(p, intersect(p,q)[0])--postcontrol(p, intersect(p,q)[0]), .8red,Arrow);
draw(point(q, intersect(p,q)[1])--postcontrol(q, intersect(p,q)[1]), .8blue,Arrow);



Étiquettes : , , ,

## Asymptote Generalities – fig1770

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

import math;

pair A=(0,0), B=(1,.5);
path cle=shift(1.75,2.5)*unitcircle;
pair pt, ptp;

pair project(pair pt, pair A, pair B)
{
return extension(pt,pt-dir(90+degrees(A-B,false)),A,B);
}

draw(A--B);
draw(cle);

for (real t=0; t<=4; t+=.01)
{
pt=point(cle,t);
ptp=project(pt,A,B);
dot(ptp, red);
draw(pt--ptp,dotted);

}



Étiquettes : , , , ,

## Asymptote Generalities – fig1780

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

import math;

pair A=(0,0), B=(1,.5), C=(.25,1);

pair project(pair pt, pair A, pair B)
{
return extension(pt,pt-dir(90+degrees(A-B,false)),A,B);
}

pair ocenter(pair A, pair B, pair C)
{
return extension(A, project(A,B,C), B, project(B,A,C));
}

draw(A--B--C--cycle);

pair orth=ocenter(A,B,C);
pair Ap=project(A,B,C);
pair Bp=project(B,A,C);
pair Cp=project(C,A,B);

dot(orth, red);
dot(Ap^^Bp^^Cp);
drawline(A, orth, dotted);
drawline(B, orth, dotted);
drawline(C, orth, dotted);



Étiquettes : , , ,

## Asymptote Generalities – fig1790

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

import math;

pair A=(0,0), B=(1,.5), C=(.25,1);

pair ccenter(pair A, pair B, pair C)
{
pair mAB=midpoint(A--B);
pair mAC=midpoint(A--C);
return extension(mAB, rotate(90,mAB)*A, mAC, rotate(90,mAC)*A);
}

draw(A--B--C--cycle);

pair circ=ccenter(A,B,C);
pair mAB=midpoint(A--B);
pair mAC=midpoint(A--C);
pair mBC=midpoint(B--C);

dot(circ, red);
dot(mAB^^mAC^^mBC);
drawline(mAB, circ, dotted);
drawline(mAC, circ, dotted);
drawline(mBC, circ, dotted);
draw(shift(circ)*scale(abs(circ-A))*unitcircle);



Étiquettes : , , , ,

## Asymptote Generalities – fig1800

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

import math;

pair A=(0,0), B=(1,.5), C=(.25,1);

pair project(pair pt, pair A, pair B)
{
return extension(pt,pt-dir(90+degrees(A-B,false)),A,B);
}

pair icenter(pair A, pair B, pair C)
{
return extension(A, A+dir(A--B,A--C), B, B+dir(B--A,B--C));
}

draw(A--B--C--cycle);

pair ins=icenter(A,B,C);
pair iAB=project(ins,A,B);
pair iAC=project(ins,A,C);
pair iBC=project(ins,B,C);

dot(ins, red);
dot(iAB^^iAC^^iBC);
drawline(A, ins, dotted);
drawline(B, ins, dotted);
drawline(C, ins, dotted);
draw(shift(ins)*scale(abs(ins-iAB))*unitcircle);



Étiquettes : , , , ,

## Asymptote Generalities – fig1810

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);
import math;

pair project(pair pt, pair A, pair B)
{
return extension(pt,pt-dir(90+degrees(A-B,false)),A,B);
}

pair ecenter(pair A, pair B, pair C)
{
return extension(A, A+rotate(90)*dir(A--B,A--C), B, B+rotate(90)*dir(B--A,B--C));
}

path ecircle(pair A, pair B, pair C)
{
return shift(ecenter(A,B,C))*scale(abs(ecenter(A,B,C)-project(ecenter(A,B,C),B,C)))*unitcircle;
}

pair A=(0,0), B=(3,0), C=(3,4);
path tr=A--B--C--cycle;

draw(ecircle(A,B,C));
draw(ecircle(B,C,A));

pen p=linewidth(1pt);
drawline(A,B, p);
drawline(A,C, p);
drawline(B,C, p);



Étiquettes : , , , , ,

## Asymptote Generalities – fig1830

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);
defaultpen(2mm+linecap(0));

path p = (0,0){up} .. (2cm,0){up};
path q = (0,1cm){dir(-60)}..(1cm,-1cm)..{dir(60)}(2cm,1cm);

draw(firstcut(p,q).before, .8red);
draw(firstcut(p,q).after, .8blue);

draw(lastcut(q,p).before, .8green);
draw(lastcut(q,p).after, .8yellow);



Étiquettes : , ,

## Asymptote Generalities – fig1840

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

defaultpen(2mm+linecap(0));

path p = (0,0){up} .. (2cm,0){up};
path q = (0,1cm){dir(-60)}..(1cm,-1cm)..{dir(60)}(2cm,1cm);

real[] ipq=intersect(p,q);
real[] iprq=intersect(p,reverse(q));

draw(subpath(p, 0, ipq[0]), .8red);
draw(subpath(p, ipq[0], iprq[0]), .5red);
draw(subpath(p, iprq[0], length(p)), .3red);

draw(subpath(reverse(q), 0, iprq[1]), .8green);
draw(subpath(reverse(q), iprq[1], length(q)-ipq[1]), .5green);
draw(subpath(reverse(q), length(q)-ipq[1], length(q)), .3green);



Étiquettes : , ,

## Asymptote Generalities – fig1870

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(15cm,0);

srand(rand());
path p1 = randompath(9);
path p2 = randompath(8);
real Minx=min(min(p1).x,min(p2).x);
real Maxx=max(max(p1).x,max(p2).x);
real Miny=min(min(p1).y,min(p2).y);

pair[] inter=intersectionpoints(p1,p2);
int nb=inter.length;
for (int i=0 ; i<nb; ++i)
{
dot(inter[i]);
label("$" + (string) i +"$", inter[i],N);
}

draw(p1,.8red);
draw(p2,.8green);
label("I found " + (string) nb + " points of intersection.",((Maxx+Minx)/2,Miny),2S);



Étiquettes : , , ,

## Asymptote Generalities – fig1890

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);
path [] c;

c[1] = xscale(2)*unitcircle;
c[2] = shift((0,1))*c[1];
draw(c[1]^^c[2]);
draw(buildcycle(c[1],c[2]), .8red+4bp);



Étiquettes : , , , , , ,

## Asymptote Generalities – fig1900

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

 (Compiled with Asymptote version 2.14svn-r5318)

//Translate from http://zoonek.free.fr/LaTeX/Metapost/metapost.html
size(6cm,0);

path a,b,c,d;
a = (-1,-.2){up} .. tension 1.2 .. (1,-.2){down};
transform r90=rotate(90);
b = r90*a;
c = r90*b;
d = r90*c;
path bound=buildcycle(a,b,c,d);
fill(bound, lightgrey);
draw(a^^b^^c^^d,grey);
draw(bound);



Étiquettes : , , , , , ,

## Asymptote Generalities – fig1910

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(6cm,0);

path a,b,c;
a = shift(1,0)*scale(2)*unitcircle;
b = rotate(120)*a;
c = rotate(120)*b;

fill(a, red);
fill(b, green);
fill(c, blue);
fill(buildcycle(a,b), red + green);
fill(buildcycle(b,c), green + blue);
fill(buildcycle(c,a), blue + red);
fill(buildcycle(a,b,c), white);

draw(a^^b^^c);



Étiquettes : , , , , , ,

## Asymptote Generalities – fig1920

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

path pt1=scale(2cm)*unitcircle;
path pt2=scale(1cm)*unitcircle;

filldraw(pt1^^pt2,yellow+.9white);



Étiquettes : , , ,

## Asymptote Generalities – fig1930

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

path pt1=scale(2cm)*unitcircle;
path pt2=scale(1cm)*unitcircle;

filldraw(pt1^^pt2,evenodd+yellow+.9white);



Étiquettes : , , , , ,

## Asymptote Generalities – fig1940

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

path pt1=scale(2cm)*unitcircle;
path pt2=scale(1cm)*unitcircle;
path pt3=shift(0,.5cm)*pt2;

filldraw(pt1^^pt2^^pt3,evenodd+yellow+.9white);



Étiquettes : , , , , ,

## Asymptote Generalities – fig1950

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(0,0);

path pt1=scale(2cm)*unitcircle;
path pt2=scale(1cm)*unitcircle;
path pt3=shift(0,1.5cm)*pt2;

filldraw(pt1^^pt2^^pt3,evenodd+yellow+.9white);



Étiquettes : , , , , ,

## Asymptote Generalities – fig1970

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

 (Compiled with Asymptote version 2.14svn-r5318)

size(8cm,0);
import patterns;

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

filldraw(shift(0,-2)*yscale(2)*unitsquare,pattern("r_hatchback"));

filldraw(shift(1,-2)*yscale(2)*unitsquare,pattern("b_hatchback"));



Étiquettes : , ,

## Official Asymptote example – BezierPatch

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import three;

size(10cm);
currentlight=Viewport;

surface s=surface(patch(new triple[][] {
{(0,0,0),(1,0,0),(1,0,0),(2,0,0)},
{(0,1,0),(1,0,1),(1,0,1),(2,1,0)},
{(0,1,0),(1,0,-1),(1,0,-1),(2,1,0)},
{(0,2,0),(1,2,0),(1,2,0),(2,2,0)}}));

draw(s,yellow);
draw(s.s[0].vequals(0.5),squarecap+2bp+blue,currentlight);
draw(s.s[0].uequals(0.5),squarecap+2bp+red,currentlight);



Étiquettes : , , ,

## Official Asymptote example – Coons

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(200);

pen[] p={red,green,blue,magenta};
path g=(0,0){dir(45)}..(1,0)..(1,1)..(0,1)..cycle;
dot(g);



Étiquettes : , ,

## Official Asymptote example – GaussianSurface

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph3;

size(200,0);

currentprojection=perspective(10,8,4);

real f(pair z) {return 0.5+exp(-abs(z)^2);}

draw((-1,-1,0)--(1,-1,0)--(1,1,0)--(-1,1,0)--cycle);

draw(arc(0.12Z,0.2,90,60,90,25),ArcArrow3);

surface s=surface(f,(-1,-1),(1,1),nx=5,Spline);

xaxis3(Label("$x$"),red,Arrow3);
yaxis3(Label("$y$"),red,Arrow3);
zaxis3(XYZero(extend=true),red,Arrow3);

draw(s,lightgray,meshpen=black+thick(),nolight,render(merge=true));

label("$O$",O,-Z+Y,red);



Étiquettes : , ,

## Official Asymptote example – Gouraud

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(200);

pen[] p={red,green,blue,magenta};
pair[] z={(-1,0),(0,0),(0,1),(1,0)};
int[] edges={0,0,0,1};

draw(z[0]--z[1]--z[2]--cycle);
draw(z[1]--z[3]--z[2],dashed);

dot(Label,z[0],W);
dot(Label,z[1],S);
dot(Label,z[2],N);
dot(Label,z[3],E);

label("0",z[0]--z[1],S,red);
label("1",z[1]--z[2],E,red);
label("2",z[2]--z[0],NW,red);



Étiquettes : ,

## Official Asymptote example – HermiteSpline

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph;

size(140mm,70mm,IgnoreAspect);
scale(false);
real[] x={1,3,4,5,6};
real[] y={1,5,2,0,4};

marker mark=marker(scale(1mm)*cross(6,false,r=0.35),red,Fill);

draw(graph(x,y,Hermite),"Hermite Spline",mark);
xaxis("$x$",Bottom,LeftTicks(x));
yaxis("$y$",Left,LeftTicks);
attach(legend(),point(NW),40S+30E,UnFill);



Étiquettes : , , , ,

## Official Asymptote example – Hobbycontrol

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(200);
pair z0=(0,0);
pair z1=(0.5,3);
pair z2=(2,1);

path g=z0..z1..z2;

pair d0=dir(g,0);
pair d1=dir(g,1);
draw(Label("$\omega_0$",1),z0-d0..z0+d0,blue+dashed,Arrow);
draw(Label("$\omega_1$",1),z1-d1..z1+1.5d1,blue+dashed,Arrow);
draw(z0--interp(z0,z1,1.5),dashed);
draw(subpath(g,0,1),blue);
draw("$\theta$",arc(z0,0.4,degrees(z1-z0),degrees(d0)),red,Arrow,
EndPenMargin);
draw("$\phi$",arc(z1,1.05,degrees(z1-z0),degrees(d1)),red,Arrow,
EndPenMargin);

dot("$z_0$",z0,SW,red);
dot("$z_1$",z1,SE,red);



Étiquettes : , , ,

## Official Asymptote example – Hobbydir

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(200);
pair z0=(0,0);
pair z1=(1,2);
pair z2=(2,1);

path g=z0..z1..z2;

label("$\ell_k$",z0--z1);
draw("$\ell_{k+1}$",z1--z2,dashed);
draw(z0--interp(z0,z1,1.5),dashed);
pair d1=dir(g,1);
draw(z1-d1..z1+d1,blue+dashed);
draw(g,blue);
draw(Label("$\theta_k$",0.4),arc(z1,0.4,degrees(z2-z1),degrees(d1)),blue,Arrow,
EndPenMargin);
draw("$\phi_k$",arc(z1,0.4,degrees(d1),degrees(z1-z0),CCW),Arrow,
EndPenMargin);

dot("$z_{k-1}$",z0,red);
dot("$z_k$",z1,NW,red);
dot("$z_{k+1}$",z2,red);



Étiquettes : , , , ,

## Official Asymptote example – Pythagoras

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(0,150);
import geometry;

real a=3;
real b=4;
real c=hypot(a,b);

pair z1=(0,b);
pair z2=(a,0);
pair z3=(a+b,0);
perpendicular(z1,NE,z1--z2,blue);
perpendicular(z3,NW,blue);
draw(square((0,0),z3));
draw(square(z1,z2));

real d=0.3;
pair v=unit(z2-z1);
draw(baseline("$a$"),-d*I--z2-d*I,red,Bars,Arrows,PenMargins);
draw(baseline("$b$"),z2-d*I--z3-d*I,red,Arrows,Bars,PenMargins);
draw("$c$",z3+z2*I-d*v--z2-d*v,red,Arrows,PenMargins);
draw("$a$",z3+d--z3+z2*I+d,red,Arrows,Bars,PenMargins);
draw("$b$",z3+z2*I+d--z3+z3*I+d,red,Arrows,Bars,PenMargins);



Étiquettes : , , , , ,

## Official Asymptote example – RiemannSurface

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph3;
import palette;

size(200,300,keepAspect=false);
//settings.nothin=true;

currentprojection=orthographic(10,10,30);
currentlight=(10,10,5);
triple f(pair t) {return (exp(t.x)*cos(t.y),exp(t.x)*sin(t.y),t.y);}

surface s=surface(f,(-4,-2pi),(0,4pi),8,16,Spline);
s.colors(palette(s.map(zpart),Rainbow()));
draw(s,render(merge=true));



Étiquettes : , , , ,

## Official Asymptote example – axis3

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph3;

size(0,200);
size3(200,IgnoreAspect);

currentprojection=perspective(5,2,2);

scale(Linear,Linear,Log);

xaxis3("$x$",0,1,red,OutTicks(2,2));
yaxis3("$y$",0,1,red,OutTicks(2,2));
zaxis3("$z$",1,30,red,OutTicks(beginlabel=false));



Étiquettes : , ,

## Official Asymptote example – bezier2

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import beziercurve;

pair midpoint(pair a, pair b) {return interp(a,b,0.5);}

pair m0=midpoint(z0,c0);
pair m1=midpoint(c0,c1);
pair m2=midpoint(c1,z1);

draw(m0--m1--m2,dashed);
dot("$m_0$",m0,NW,red);
dot("$m_1$",m1,N,red);
dot("$m_2$",m2,red);

pair m3=midpoint(m0,m1);
pair m4=midpoint(m1,m2);
pair m5=midpoint(m3,m4);

draw(m3--m4,dashed);
dot("$m_3$",m3,NW,red);
dot("$m_4$",m4,NE,red);
dot("$m_5$",m5,N,red);



Étiquettes : , ,

## Official Asymptote example – beziercurve

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(400);
pair z0=(0,0);
pair c0=(1,1);
pair c1=(2,1);
pair z1=(3,0);
draw(z0..controls c0 and c1 .. z1,blue);

draw(z0--c0--c1--z1,dashed);
dot("$z_0$",z0,W,red);
dot("$c_0$",c0,NW,red);
dot("$c_1$",c1,NE,red);
dot("$z_1$",z1,red);



Étiquettes : , ,

## Official Asymptote example – cardioid

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph;

size(0,100);

real f(real t) {return 1+cos(t);}

path g=polargraph(f,0,2pi,operator ..)--cycle;
filldraw(g,pink);

xaxis("$x$",above=true);
yaxis("$y$",above=true);

dot("$(a,0)$",(1,0),N);
dot("$(2a,0)$",(2,0),N+E);



Étiquettes : ,

## Official Asymptote example – circles

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(6cm,0);
import math;

currentpen=magenta;

real r1=1;
real r2=sqrt(7);
real r3=4;
pair O=0;

path c1=circle(O,r1);
draw(c1,green);
draw(circle(O,r2),green);
draw(circle(O,r3),green);

real x=-0.6;
real y=-0.8;
real yD=0.3;
pair A=(sqrt(r1^2-y^2),y);
pair B=(-sqrt(r2^2-y^2),y);
pair C=(x,sqrt(r3^2-x^2));

pair d=A+r2*dir(B--C);
pair D=intersectionpoint(c1,A--d);

draw(A--B--C--cycle);
draw(interp(A,D,-0.5)--interp(A,D,1.5),blue);

dot("$O$",O,S,red);
dot("$A$",A,dir(C--A,B--A),red);
dot("$B$",B,dir(C--B,A--B),red);
dot("$C$",C,dir(A--C,B--C),red);
dot("$D$",D,red);



Étiquettes : , , ,

## Official Asymptote example – colons

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

draw((0,0){up}::(100,25){right}::(200,0){down});



Étiquettes : ,

## Official Asymptote example – cosaddition

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(0,200);
import geometry;

real A=130;
real B=40;

pair O=(0,0);
pair R=(1,0);
pair P=dir(A);
pair Q=dir(B);

draw(circle(O,1.0));
draw(Q--O--P);
draw(P--Q,red);
draw(O--Q--R--cycle);

draw("$A$",arc(R,O,P,0.3),blue,Arrow,PenMargin);
draw("$B$",arc(R,O,Q,0.6),blue,Arrow,PenMargin);
pair S=(Cos(B),0);
draw(Q--S,blue);
perpendicular(S,NE,blue);

dot(O);
dot("$R=(1,0)$",R);
dot("$P=(\cos A,\sin A)$",P,dir(O--P)+W);
dot("$Q=(\cos B,\sin B)$",Q,dir(O--Q));



Étiquettes : , , ,

## Official Asymptote example – cube

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import three;

currentprojection=orthographic(5,4,2,center=true);

size(5cm);
size3(3cm,5cm,8cm);

draw(unitbox);

dot(unitbox,red);

label("$O$",(0,0,0),NW);
label("(1,0,0)",(1,0,0),S);
label("(0,1,0)",(0,1,0),E);
label("(0,0,1)",(0,0,1),Z);



Étiquettes : , ,

## Official Asymptote example – curvedlabel

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(200);
import labelpath;
labelpath("This is a test of curved labels in Asymptote (implemented with the {\tt PSTricks pstextpath} macro).",reverse(rotate(-90)*unitcircle));



Étiquettes : , ,

## Official Asymptote example – cylinder

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import solids;

size(0,100);
currentlight=Viewport;

revolution r=cylinder(O,1,1.5,Y+Z);
draw(surface(r),green,render(merge=true));
draw(r,blue);



Étiquettes : , ,

## Official Asymptote example – cylinderskeleton

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import solids;

size(0,100);

revolution r=cylinder(O,1,1.5,Y+Z);
draw(r,heavygreen);



Étiquettes : , ,

## Official Asymptote example – dots

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

draw((0,0){up}..(100,25){right}..(200,0){down});



Étiquettes : , ,

## Official Asymptote example – epix

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph3;

size(200,200,IgnoreAspect);

currentprojection=perspective(4,2,3);

real f(pair z) {return z.y^3/2-3z.x^2*z.y;}

draw(surface(f,(-1,-1),(1,1),nx=10,Spline),green,render(merge=true));
draw(Label("$y$",1),(0,0,0)--(0,2,0),red,Arrow3);

draw(Label("$x$",1),(0,0,0)--(2,0,0),red,Arrow3);
draw(Label("$z$",1),(0,0,0)--(0,0,2.5),red,Arrow3);
label("$z=\frac{1}{2}y^3-3x^2y$",(1,1,1),NE);



Étiquettes : , ,

## Official Asymptote example – equilateral

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(10cm,0);
import math;

pair b=(0,0), c=(1,0);
pair a=extension(b,b+dir(60),c,c+dir(120));
pair d=extension(b,b+dir(30),a,a+dir(270));

draw(a--b--c--a--d--b^^d--c);
label("$A$",a,N);
label("$B$",b,W);
label("$C$",c,E);
label("$D$",d,S);



Étiquettes : , ,

## Official Asymptote example – exp

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph;
size(150,0);

real f(real x) {return exp(x);}
pair F(real x) {return (x,f(x));}

xaxis("$x$");
yaxis("$y$",0);

draw(graph(f,-4,2,operator ..),red);

labely(1,E);
label("$e^x$",F(1),SE);



Étiquettes : ,

## Official Asymptote example – fano

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import math;

size(100,0);

pair z4=(0,0);
pair z7=(2,0);
pair z1=point(rotate(60)*(z4--z7),1);

pair z5=interp(z4,z7,0.5);
pair z3=interp(z7,z1,0.5);
pair z2=interp(z1,z4,0.5);
pair z6=extension(z4,z3,z7,z2);

draw(z4--z7--z1--cycle);
draw(z4--z3);
draw(z7--z2);
draw(z1--z5);
draw(circle(z6,abs(z3-z6)));

label("1",z1,dir(z5--z1));
label("2",z2,dir(z7--z2));
label("3",z3,dir(z4--z3));
label("4",z4,dir(z3--z4));
label("5",z5,dir(z1--z5));
label("6",z6,2.5E+0.1*N);
label("7",z7,dir(z2--z7));



Étiquettes : , , , ,

## Official Asymptote example – hatch

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(0,100);
import patterns;

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 – labelsquare

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(3cm);
draw(unitsquare);
label("$A$",(0,0),SW);
label("$B$",(1,0),SE);
label("$C$",(1,1),NE);
label("$D$",(0,1),NW);



Étiquettes : , ,

## Official Asymptote example – latticeshading

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(200);

pen[][] p={{white,grey,black},
{red,green,blue},
{cyan,magenta,yellow}};



Étiquettes : , ,

## Official Asymptote example – lever

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(200,0);

pair z0=(0,0);
pair z1=(2,0);
pair z2=(5,0);
pair zf=z1+0.75*(z2-z1);

draw(z1--z2);
dot(z1,red+0.15cm);
dot(z2,darkgreen+0.3cm);
label("$m$",z1,1.2N,red);
label("$M$",z2,1.5N,darkgreen);
label("$\hat{\ }$",zf,0.2*S,fontsize(24pt)+blue);

pair s=-0.2*I;
draw("$x$",z0+s--z1+s,N,red,Arrows,Bars,PenMargins);

s=-0.5*I;
draw("$\bar{x}$",z0+s--zf+s,blue,Arrows,Bars,PenMargins);

s=-0.95*I;
draw("$X$",z0+s--z2+s,darkgreen,Arrows,Bars,PenMargins);



Étiquettes : , , ,

## Official Asymptote example – lineargraph

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph;

size(250,200,IgnoreAspect);

real Sin(real t) {return sin(2pi*t);}
real Cos(real t) {return cos(2pi*t);}

draw(graph(Sin,0,1),red,"$\sin(2\pi x)$");
draw(graph(Cos,0,1),blue,"$\cos(2\pi x)$");

xaxis("$x$",BottomTop,LeftTicks);
yaxis("$y$",LeftRight,RightTicks(trailingzero));

label("LABEL",point(0),UnFill(1mm));

attach(legend(),truepoint(E),20E,UnFill);



Étiquettes : , , , ,

## Official Asymptote example – lineargraph0

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph;

size(400,200,IgnoreAspect);

real Sin(real t) {return sin(2pi*t);}
real Cos(real t) {return cos(2pi*t);}

draw(graph(Sin,0,1),red,"$\sin(2\pi x)$");
draw(graph(Cos,0,1),blue,"$\cos(2\pi x)$");

xaxis("$x$",BottomTop,LeftTicks);
yaxis("$y$",LeftRight,RightTicks(trailingzero));

label("LABEL",point(0),UnFill(1mm));



Étiquettes : , , , ,

## Official Asymptote example – lines

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import math;

int n=7;

size(200,0);

draw(unitcircle,red);
for (int i=0; i < n-1; ++i)
for (int j=i+1; j < n; ++j)
drawline(unityroot(n,i),unityroot(n,j),blue);



Étiquettes : , ,

## Official Asymptote example – linetype

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

void testline(real y) {
draw((0,y)--(100,y),currentpen+solid);
draw((0,y-10)--(100,y-10),currentpen+dotted);
draw((0,y-20)--(100,y-20),currentpen+dashed);
draw((0,y-30)--(100,y-30),currentpen+longdashed);
draw((0,y-40)--(100,y-40),currentpen+dashdotted);
draw((0,y-50)--(100,y-50),currentpen+longdashdotted);
draw((0,y-60)--(100,y-60),currentpen+Dotted);
}

currentpen=linewidth(0.5);
testline(100);



Étiquettes : , ,

## Official Asymptote example – log

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph;

size(150,0);

real f(real x) {return log(x);}
pair F(real x) {return (x,f(x));}

xaxis("$x$",0);
yaxis("$y$");

draw(graph(f,0.01,10,operator ..));

labelx(1,SSE);
label("$\log x$",F(7),SE);



Étiquettes : ,

## Official Asymptote example – oneoverx

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph;
size(200,IgnoreAspect);

real f(real x) {return 1/x;};

bool3 branch(real x)
{
static int lastsign=0;
if(x == 0) return false;
int sign=sgn(x);
bool b=lastsign == 0 || sign == lastsign;
lastsign=sign;
return b ? true : default;
}

draw(graph(f,-1,1,branch));
axes("$x$","$y$",red);



Étiquettes : , ,

## Official Asymptote example – parametricgraph

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph;

size(0,200);

real x(real t) {return cos(2pi*t);}
real y(real t) {return sin(2pi*t);}

draw(graph(x,y,0,1));

//xlimits(0,1,Crop);
//ylimits(-1,0,Crop);

xaxis("$x$",BottomTop,LeftTicks);
yaxis("$y$",LeftRight,RightTicks(trailingzero));



Étiquettes : ,

## Official Asymptote example – parametricsurface

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph3;

size(200,0);
currentprojection=orthographic(4,0,2);

real R=2;
real a=1.9;

triple f(pair t) {
return ((R+a*cos(t.y))*cos(t.x),(R+a*cos(t.y))*sin(t.x),a*sin(t.y));
}

pen p=rgb(0.2,0.5,0.7);
surface s=surface(f,(0,0),(2pi,2pi),8,8,Spline);

// surface only
//draw(s,lightgray);

// mesh only
// draw(s,nullpen,meshpen=p);

// surface & mesh
draw(s,lightgray,meshpen=p,render(merge=true));



Étiquettes : , ,

## Official Asymptote example – projectelevation

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph3;
import grid3;
import palette;

currentprojection=orthographic(0.8,1,2);
size(400,300,IgnoreAspect);

real f(pair z) {return cos(2*pi*z.x)*sin(2*pi*z.y);}

surface s=surface(f,(-1/2,-1/2),(1/2,1/2),50,Spline);

surface S=planeproject(unitsquare3)*s;
S.colors(palette(s.map(zpart),Rainbow()));
draw(S,nolight);
draw(s,lightgray+opacity(0.7));

grid3(XYZgrid);



## Official Asymptote example – projectrevolution

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import solids;
import palette;

currentprojection=orthographic(20,0,3);

size(400,300,IgnoreAspect);

revolution r=revolution(new real(real x) {return sin(x)*exp(-x/2);},
0,2pi,operator ..,Z);
surface s=surface(r);

surface S=planeproject(shift(-Z)*unitsquare3)*s;
S.colors(palette(s.map(zpart),Rainbow()));

render render=render(compression=Low,merge=true);
draw(S,render);
draw(s,lightgray,render);



Étiquettes : , , , , , , ,

## Official Asymptote example – quartercircle

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(100,0);
draw((1,0){up}..{left}(0,1),Arrow);



Étiquettes : , ,

## Official Asymptote example – ring

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(0,100);
path unitcircle=E..N..W..S..cycle;
path g=scale(2)*unitcircle;
label("$a \le r \le b$");



Étiquettes : , ,

## Official Asymptote example – roll

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph3;

size(200,0);

triple f(pair t) {
return(t.x+t.y/4+sin(t.y),cos(t.y),sin(t.y));
}

surface s=surface(f,(0,0),(2pi,2pi),7,20,Spline);
draw(s,olive,render(merge=true));



Étiquettes : , ,

## Official Asymptote example – saddle

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import three;

size(100,0);
path3 g=(1,0,0)..(0,1,1)..(-1,0,0)..(0,-1,1)..cycle;
draw(g);
draw(((-1,-1,0)--(1,-1,0)--(1,1,0)--(-1,1,0)--cycle));
dot(g,red);



Étiquettes : , , ,

## Official Asymptote example – shade

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(100,0);



Étiquettes : ,

## Official Asymptote example – shadedtiling

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

 (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;
fill(tiling,shift(d,d)*square,blue);



Étiquettes : , , ,

## Official Asymptote example – shadestroke

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(100);

red+linewidth(30),(0,0),0.25,yellow,(0,0),1);



Étiquettes : ,

## Official Asymptote example – sin1x

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph;
size(200,0);

real f(real x) {return (x != 0) ? sin(1/x) : 0;}
real T(real x) {return 2/(x*pi);}

real a=-4/pi, b=4/pi;
int n=150,m=5;

xaxis("$x$",red);
yaxis(red);

draw(graph(f,a,-T(m),n)--graph(f,-m,-(m+n),n,T)--(0,f(0))--graph(f,m+n,m,n,T)--
graph(f,T(m),b,n));

label("$\sin\frac{1}{x}$",(b,f(b)),SW);



Étiquettes : , ,

## Official Asymptote example – sphere

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import three;

size(200);
currentprojection=orthographic(5,4,3);

draw(unitsphere,green,render(compression=Zero,merge=true));



Étiquettes : , ,

## Official Asymptote example – spheresilhouette

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import solids;
settings.render=0;
settings.prc=false;

size(200);

revolution r=sphere(O,1);
draw(r,1,longitudinalpen=nullpen);
draw(r.silhouette());



Étiquettes : , , , ,

## Official Asymptote example – sphereskeleton

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(100);
import solids;

currentprojection=orthographic(5,4,2);

revolution sphere=sphere(1);
draw(surface(sphere),green+opacity(0.2));
draw(sphere,m=7,blue);



Étiquettes : , , , ,

## Official Asymptote example – spiral

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(0,150);
import graph;

real f(real t) {return exp(-t/(2pi));}

draw(polargraph(f,0,20*pi,operator ..));

xaxis("$x$",-infinity,1.3);
yaxis("$y$",-infinity,1);

labelx(1);
labelx("$e^{-1}$",1.0/exp(1),SE);



Étiquettes : , , ,

## Official Asymptote example – spring0

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import spring;

drawspring(0,"$L$");



Étiquettes : ,

## Official Asymptote example – spring2

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import spring;

drawspring(40.0,"$L+x$");



Étiquettes : ,

## Official Asymptote example – square

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(3cm);
draw((0,0)--(1,0)--(1,1)--(0,1)--cycle);



Étiquettes : ,

## Official Asymptote example – star

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(100);
import math;

int n=5;
path p;

int i=0;
do {
p=p--unityroot(n,i);
i=(i+2) % n;
} while(i != 0);

filldraw(p--cycle,red+evenodd);



Étiquettes : , , , ,

## Official Asymptote example – subpictures

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

picture pic1;
real size=50;
size(pic1,size);
fill(pic1,(0,0)--(50,100)--(100,0)--cycle,red);

picture pic2;
size(pic2,size);
fill(pic2,unitcircle,green);

picture pic3;
size(pic3,size);
fill(pic3,unitsquare,blue);

picture pic;



Étiquettes : , ,

## Official Asymptote example – tanh

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph;
size(100,0);

real f(real x) {return tanh(x);}
pair F(real x) {return (x,f(x));}

xaxis("$x$");
yaxis("$y$");

draw(graph(f,-2.5,2.5,operator ..));

label("$\tanh x$",F(1.5),1.25*N);



Étiquettes : , ,

## Official Asymptote example – triangle

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(0,100);
import geometry;

triangle t=triangle(b=3,alpha=90,c=4);

dot((0,0));

draw(t);
draw(rotate(90)*t,red);
draw(shift((-4,0))*t,blue);
draw(reflect((0,0),(1,0))*t,green);
draw(slant(2)*t,magenta);



Étiquettes : , , ,

## Official Asymptote example – trumpet

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph3;
size(200,0);

currentlight=Viewport;

triple f(pair t) {
real u=log(abs(tan(t.y/2)));
return (10*sin(t.y),cos(t.x)*(cos(t.y)+u),sin(t.x)*(cos(t.y)+u));
}

surface s=surface(f,(0,pi/2),(2pi,pi-0.1),7,15,Spline);
draw(s,olive+0.25*white,render(compression=Low,merge=true));



Étiquettes : , ,

## Official Asymptote example – unitcircle

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(0,150);

pair z0=0;
pair z1=1;
real theta=30;
pair z=dir(theta);

draw(circle(z0,1));
filldraw(z0--arc(z0,1,0,theta)--cycle,lightgrey);
dot(z0);
dot(Label,z1);
dot("$(x,y)=(\cos\theta,\sin\theta)$",z);
arrow("area $\frac{\theta}{2}$",dir(0.5*theta),2E);
draw("$\theta$",arc(z0,0.7,0,theta),LeftSide,Arrow,PenMargin);



Étiquettes : , , , , ,

## Official Asymptote example – xsin1x

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

import graph;
size(300,0);

real f(real x) {return (x != 0.0) ? x * sin(1.0 / x) : 0.0;}
pair F(real x) {return (x,f(x));}

xaxis("$x$",red);
yaxis(red);
draw(graph(f,-1.2/pi,1.2/pi,1000));
label("$x\sin\frac{1}{x}$",F(1.1/pi),NW);

picture pic;
size(pic,50,IgnoreAspect);
xaxis(pic,red);
yaxis(pic,red);
draw(pic,graph(pic,f,-0.1/pi,0.1/pi,1000));

add(new void(frame f, transform t) {
frame G=shift(point(f,N+0.85W))*align(bbox(pic,blue),10SE);
draw(f,t*box(min(pic,user=true),max(pic,user=true)),blue);
draw(f,point(G,E)--t*point(pic,W),blue);
});



Étiquettes : , ,

## Official Asymptote example – yingyang

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

 (Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */

size(0,25cm);
guide center=(0,1){W}..tension 0.8..(0,0){(1,-.5)}..tension 0.8..{W}(0,-1);

draw((0,1)..(-1,0)..(0,-1));
filldraw(center{E}..{N}(1,0)..{W}cycle);
unfill(circle((0,0.5),0.125));
fill(circle((0,-0.5),0.125));



Étiquettes : , , , ,

## Various code with Asymptote – fig0200

Category: Asymptote,MiscellaneousPh. Ivaldi @ 22 h 11 min

 (Compiled with Asymptote version 1.87svn-r4652)

size(10cm);
path g=box((-1,-1),(1,1));
pen [] col= new pen[]{gray,yellow};

path pairToSquare(pair pt){ return pt -- I*pt -- -pt -- -I*pt --cycle; }

int nb=10;
for (int i=0; i<nb; ++i)
{
filldraw(g,col[i%2]);
g=pairToSquare(relpoint(g,1/16));
}



Étiquettes : , , ,