## 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 – 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 using geometry.asy – fig0120

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 17 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(10cm,0);

currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-1,1));
coordsys Rp=currentcoordsys;
coordsys R=defaultcoordsys;

show("$O$","$\vec{\imath}$", "$\vec{\jmath}$", R);
show("$O'$", "$\vec{u}$", "$\vec{v}$", Rp, xpen=invisible);

pair a=(0.5,0.5);
pair b=(-0.5,-1);

point A=point(R,a), B=point(R,b);
dot("$A$",A,NW); dot("$B$",B,S);
line l=line(A,B);

point Ap=a, Bp=b;
dot("$A'$",Ap,W); dot("$B'$",Bp,SE);
line lp=line(Ap,Bp);

draw(l^^lp);

draw(l.A--l.A+l.u,blue,Arrow);
draw(l.A--l.A+l.v,blue,Arrow);
draw(lp.A--lp.A+lp.u,blue,Arrow);
draw(lp.A--lp.A+lp.v,blue,Arrow);



Étiquettes : , , , ,

## Asymptote using geometry.asy – fig0130

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 18 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(10cm,0);

currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-1,1));
coordsys Rp=currentcoordsys;
coordsys Rs=cartesiansystem((-1,2),i=(-1,0.5),j=(-1,-1));
coordsys R=defaultcoordsys;

show("$O$","$\vec{\imath}$", "$\vec{\jmath}$", R);
show("$O'$","$\vec{u}$","$\vec{v}$", Rp, xpen=invisible);
show("$O''$", "$\vec{u'}$", "$\vec{v'}$", Rs, xpen=invisible);

pair a=(0.5,0.5);
pair b=(-0.5,-1);

point A=point(R,a), B=point(R,b);
dot("$A$",A,S); dot("$B$",B,S);
line l=line(A,B);

point Ap=a, Bp=b;
dot("$A'$",Ap); dot("$B'$",Bp,SE);
line lp=line(Ap,Bp);

point As=point(Rs,a), Bs=point(Rs,b);
dot("$A''$",As,S); dot("$B''$",Bs,SE);
line ls=line(As,Bs);

draw(l^^lp^^ls);

dot(intersectionpoint(l,lp),2mm+red);
dot(intersectionpoint(l,ls),2mm+red);
dot(intersectionpoint(lp,ls),2mm+red);



Étiquettes : , , , , ,

## Asymptote using geometry.asy – fig0140

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 19 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

include fig0130;

point w=l.A+1.5*l.v;
draw(Label("$w$",EndPoint),l.A--w,Arrow);

point wp=lp.A+1.5*lp.v;
draw(Label("$w'$",EndPoint),lp.A--wp,Arrow);

point ws=ls.A+1.5*ls.v;
draw(Label("$w''$",EndPoint),ls.A--ws,Arrow);

int n=64;
real step=2pi/n;

for (int i=0; i<n; ++i) {
point p=B+point(R,R.polar(1,step*i));
dot(p,sameside(p,w,l) ? black : blue);

point p=Ap+point(Rp,Rp.polar(1,step*i));
dot(p,sameside(p,wp,lp) ? black : blue);

point p=As+point(Rs,Rs.polar(1,step*i));
dot(p,sameside(p,ws,ls) ? black : blue);
}



Étiquettes : , , , , ,

## Asymptote using geometry.asy – fig0150

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 20 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

size(12cm,0);
import geometry;
import base_pi;
dotfactor*=2;

currentcoordsys=cartesiansystem((0,0),i=(1,0.5),j=(-1,1));
coordsys Rp=currentcoordsys;
show("$O'$","$\vec{u}$","$\vec{v}$", Rp, xpen=invisible);

path cle=randompath(20);
draw(cle);

point A=(0,1.5), B=(1,-0.5);

line l=line(A,B);
draw(l);

/* View the definition of pair[] intersectionpoints(line,path) */
dot(intersectionpoints(l,cle));



Étiquettes : , , ,

## Asymptote using geometry.asy – fig0160

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 21 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

size(10cm);
import geometry;
dotfactor*=1.5;
linemargin = 5mm;

currentcoordsys=cartesiansystem((2,1),i=(1,1),j=(-4,1));
show(currentcoordsys);

point A=(1,1), B=(2,1);
/* View the definition of struct line */
line l1=line(A,B);/* View the definition of line line(point,bool,point,bool) */

/* View the definition of void draw(picture,Label,line,bool,bool,align,pen,arrowbar,Label,marker) */
draw(l1,red);
dot("$A$",A);
dot("$B$",B);

for (int i=0; i<10; ++i){
}



Étiquettes : , , , ,

## Asymptote using geometry.asy – fig0170

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 22 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

unitsize(1cm);
import geometry;
dotfactor*=1.5;
linemargin=5mm;

// currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-1,1));
show(currentcoordsys);

point A=(-3,-1), B=(3,4);
line l1=line(A,B);

draw(l1,red);
dot("$A$",A,SE);
dot("$B$",B,NW);

point M=(2,-2);
dot("$M$",M);

/* View the definition of line parallel(point,line) */
draw(parallel(M,l1),red);

/* View the definition of line perpendicular(point,line) */
line perp=perpendicular(M,l1);
draw(perp);

/* View the definition of point intersectionpoint(line,line) */
point interp=intersectionpoint(l1,perp);
dot(interp,green);

/* View the definition of void markrightangle(picture,point,point,point,real,pen,margin,filltype) */
markrightangle(l1.A,interp,rotate(180,interp)*M,size=5mm);

draw(box((-5,-5),(5,5)),invisible);



Étiquettes : , , , , , , ,

## Asymptote using geometry.asy – fig0180

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 23 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

unitsize(1cm);
import geometry;
dotfactor*=1.5;

currentcoordsys=cartesiansystem((0,0),i=expi(pi/8)*(1.5,0),j=expi(pi/8)*(0,1));
show(currentcoordsys);

point A=(-1,-3), B=(5,2);
line l1=line(A,B);

draw(l1,red);
dot("$A$",A,SE);
dot("$B$",B,NW);

point M=(3,-3);
dot("$M$",M);

/* View the definition of transform projection(line) */
point P=projection(l1)*M;
dot("$P$",P,2W);
draw(M--P);
markrightangle(l1.A,P,M);

/* View the definition of transform vprojection(line,bool) */
point Q=vprojection(l1)*M;
dot("$Q$",Q,2W);
draw(M--Q);

/* View the definition of transform hprojection(line,bool) */
point R=hprojection(l1)*M;
dot("$R$",R,2W);
draw(M--R);

/* View the definition of transform projection(line,line,bool) */
point S=projection(l1,line((0,0),(0,1)))*M;
dot("$S$",S,2W);
draw(M--S,red);

draw(box((-1,-4),(7,5)),invisible);



Étiquettes : , , , , , ,

## Asymptote using geometry.asy – fig0190

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 0 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

unitsize(1cm);
import geometry;
dotfactor*=1.5;
linemargin=5mm;

// currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-1,1));
show(currentcoordsys);

point A=(-3,-3), B=(3,4), C=(1,-2);

line l1=line(A,B);
draw(l1,red);
dot("$A$",A,SE);
dot("$B$",B,NW);

/* View the definition of line line(real,point) */
line l2=line(100,C);
draw(l2,blue);
dot("$C$",C);

point M=relpoint(A--C,0.6);
dot("$M$",M);

/* View the definition of transform projection(line,line,bool) */
point P=projection(l1,l2)*M;
dot("$P$",P,2W);
draw(line(M,P),blue+dashed);

draw(box((-5,-5),(5,5)),invisible);



Étiquettes : , , , ,

## Asymptote using geometry.asy – fig0200

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 1 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

size(12cm);
import geometry;
dotfactor*=1.5;

currentcoordsys=cartesiansystem((2,1),i=(1,1),j=(-4,1));
show(currentcoordsys);

point A=(1,1), B=(2,1);
line l1=line(A,B);

draw(l1);
dot("$A$",A);
dot("$B$",B);

point C=(-1,0), D=(-2,-2);
line l2=line(C,D);

draw(l2);
dot("$C$",C,S);
dot("$D$",D,N);

point M=(2,-0.5);
dot("$M$",M,0.8*red);

/* View the definition of point[] sameside(point,line,line) */
point[] Ms=sameside(M,l1,l2);
draw(M--Ms[0]^^M--Ms[1],0.8red);
dot(Ms[0]^^Ms[1],0.8red);

point P=(-3,-1);
dot("$P$",P,S,blue);

point[] Ps=sameside(P,l1,l2);
draw(P--Ps[0]^^P--Ps[1],blue);
dot(Ps[0]^^Ps[1],blue);

point Q=(2,1.5);
dot("$Q$",Q,N,green);

point[] Qs=sameside(Q,l1,l2);
draw(Q--Qs[0]^^Q--Qs[1],green);
dot(Qs[0]^^Qs[1],green);



Étiquettes : , , , ,

## Asymptote using geometry.asy – fig0210

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 2 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

size(12cm);
import geometry;

currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-0.25,1));
show(currentcoordsys);

point A=(1,1);
line l1=line(45,A);
draw("$(l_1)$",l1);
dot("$A$",A);

point B=(3,1);
line l2=line(-60,B);
draw("$(l_2)$",l2);
dot("$B$",B);

/* View the definition of void markangle(picture,Label,int,real,real,line,line,arrowbar,pen,filltype,margin,marker) */
markangle(2,l2,l1,0.8*green,StickIntervalMarker(i=1,n=2));

l2,l1,0.8*blue);

markangle(reverse(l2),reverse(l1),Arrow,StickIntervalMarker(i=1,n=2));

/* View the definition of real sharpdegrees(line,line) */
markangle((string) sharpdegrees(l2,l1),
reverse(l2),l1,Arrow,red);



Étiquettes : , , ,

## Asymptote using geometry.asy – fig0220

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 3 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

unitsize(2cm);
import geometry;

currentcoordsys=cartesiansystem((2,1),i=(1,0.25),j=(-0.25,.75));
show(lo=Label("$O$",align=SE+0.5E), currentcoordsys);

pair A=(1,1), B=(2,2);
line l1=line(A,B);
draw("$(l_1)$",l1);

line l2=rotate(100,(3,3))*l1;
draw("$(l_2)$",l2);
write(locate(intersectionpoint(l1,l2)));
/* View the definition of line bisector(line,line,real,bool) */
line bis=bisector(l1,l2);
draw(bis);

line Bis=bisector(l1,l2,90);
draw(Bis,0.8*red);

/* View the definition of void markangle(picture,Label,int,real,real,line,line,arrowbar,pen,filltype,margin,marker) */
markangle(2, l1, l2, StickIntervalMarker(2,2,true));

/* View the definition of bool concurrent(...line[]) */
if (concurrent(bis,l1,l2,Bis)) label("Concurrent",(3,3), dir(135));

draw(box(locate((-1,0)),locate((5,5))),invisible);



Étiquettes : , , , ,

## Asymptote using geometry.asy – fig0230

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 4 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(12cm,0);

currentcoordsys=cartesiansystem((2,1),i=expi(pi/18)*(1,0),j=expi(pi/18)*(0,1));
show(currentcoordsys,xpen=invisible);

point A=(-1.5,-1);
point C=(-1,1);
point B=(-1,0);

dot("$A$", A, 2W);
dot("$B$", B, 2E);

line l1=hline()+C;
draw("$(l_1)$", l1, blue);
dot("$C$", C, NE);

line l2=line(A, B, false);
draw(Label("$(AB]$",Relative(.25),SE), l2, green);

/* View the definition of line complementary(explicit line) */
draw("Complementary of $(AB]$", complementary(l2), dotted+roundcap);

point p=intersectionpoint(l1,l2);

/* View the definition of bool defined(pair) */
string s="$(l_1)$" + (defined(p) ? " intersects " : " does not intersect ") + "$(AB]$";
label(s, A+1.75*l2.u,W);

draw(box(locate((-2,-2)),locate((2,2))), invisible);



Étiquettes : , , ,

## Asymptote using geometry.asy – fig0240

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 5 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(15cm,0);

// currentcoordsys=cartesiansystem((2,1),i=(1,0.25),j=(-0.25,.75));
// show(lj=Label("$\vec{\jmath}$",EndPoint), currentcoordsys);

point A=(-1,-0.5);
point B=(1,-0.5);
point C=(-1,0.5);

line l1=line(A,B);
draw("$(l_1)$",l1,red);

/* View the definition of struct segment */
segment s=segment(A,B);
draw(s, linewidth(2bp));
dot("$A$", A, SW);
dot("$B$", B, SE);
dot("$C$", C, S);

segment s1=parallel(C,s);
draw(Label("$s_1$",Relative(0.75)),s1);

Label lt=Label("Complementary of $s_1$",Relative(0.5),align=N,grey);
Label[] L={lt, lt};

/* View the definition of line[] complementary(explicit segment) */
line[] cs1=complementary(s1);

/* View the definition of void draw(picture,Label[],line[],align,pen,arrowbar,Label,marker) */
draw(L, cs1, 2mm+lightgrey);

draw(box(locate((-2.5,-1)),locate((2.5,1))), invisible);



Étiquettes : , , , ,

## Asymptote using geometry.asy – fig0250

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 6 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

unitsize(2cm);
import geometry;
linemargin=5mm;

// currentcoordsys=cartesiansystem((2,1),i=(1,0.25),j=(-0.25,.75));
// show(li=Label("$\vec{\imath}$",align=S,EndPoint), currentcoordsys);

point A=(-1,-1), B=(1,0.5);
line l1=line(A,B);

draw("$(l_1)$",l1);
draw("$s_1$",(segment) l1, 2pt+red,
marker(stickframe,markuniform(2,true)));

/* View the definition of line bisector(segment,real) */
line bis=bisector((segment) l1);
draw(bis,red);

/* View the definition of void show(picture,line,pen) */
show(bis,grey);

/* View the definition of point point(line,real) */
dot(point(bis,1.5));

draw(box(locate((-2,-2)),locate((2,2))),invisible);



Étiquettes : , , ,

## Asymptote using geometry.asy – fig0340

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 15 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(10cm,0);

// currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-0.25,.75));
// show(currentcoordsys);

point F1=(1,0);
point F2=(4,1);
dot("$F_1$",F1,W);
dot("$F_2$",F2);

// Enlarge the bounding box of the current picture
draw(box((0,-2), (5,4)), invisible);

/* View the definition of hyperbola hyperbola(point,point,real,bool) */
hyperbola h=hyperbola(F1, F2, 0.9);
draw(h, linewidth(3mm));
draw(h.A1, grey);
draw(h.A2, grey);
draw(h.D1);
draw(h.D2);

/* View the definition of hyperbola hyperbola(point,real,real,real) */
draw(hyperbola(h.C, h.a, h.b, h.angle), 2mm+green);

/* View the definition of hyperbola hyperbola(bqe) */
draw(hyperbola(equation(h)), 1mm+red);

/* View the definition of hyperbola conj(hyperbola) */
hyperbola ch=conj(h);
draw(ch, blue);
draw(ch.A1, 0.5blue);
draw(ch.A2, 0.5blue);
draw(ch.D1);
draw(ch.D2);
dot("${V'}_1$", ch.V1, NE);
dot("${V'}_2$", ch.V2, SW);
dot("${F'}_1$", ch.F1, S);
dot("${F'}_2$", ch.F2, N);

dot("$V_1$", h.V1, 2E, linewidth(2mm));
dot("$V_2$", h.V2, 2W, linewidth(2mm));



Étiquettes : , , , , ,

## Asymptote using geometry.asy – fig0350

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 16 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(8cm,0);

currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-0.25,.75));
show(currentcoordsys, xpen=invisible);

point A=(-1,0);
point B=(0.5,-3sin(2));
dot("$A$",A,S,red);
dot("$B$",B,N,red);

line l=line(A,B);
circle c=circle((point)(0,-sqrt(2)/2),exp(1));
draw(l);
draw(c);

/* View the definition of point[] intersectionpoints(line,circle) */
point[] inter=intersectionpoints(l,c);
dot("$M$", inter[0], 2S, red);
dot("$N$", inter[1], 2N+0.5W, red);



Étiquettes : , , ,

## Asymptote using geometry.asy – fig0360

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 17 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(8cm,0);

currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-0.25,.75));
show(currentcoordsys);

point A=(-1,0);
point B=(0.5,-3sin(2));
dot("$A$",A,S,red);
dot("$B$",B,N,red);

line l=line(A,B);
ellipse el=ellipse((0,-sqrt(2)/2),3,2,90);
draw(l);
draw(el,Arrow);

/* View the definition of point[] intersectionpoints(line,ellipse) */
point[] inter=intersectionpoints(l,el);
dot("$M$", inter[0], 4N+2W, red);
dot("$N$", inter[1], 2S+0.5E, red);



Étiquettes : , , ,

## Asymptote using geometry.asy – fig0370

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 18 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(10cm);

// currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-0.25,.75));
// show(currentcoordsys);

point A=(-1,-1);
point B=(2,1);
dot("$A$",A,S,red);
dot("$B$",B,N,red);

line l=line(A,B);
draw(l);

point F=(2,-1.5);
dot("$F$",F,N);

parabola p=parabola(F,0.2,110);
draw(p);

/* View the definition of point[] intersectionpoints(line,parabola) */
point[] inter=intersectionpoints(l,p);
dot("$M$", inter[0], 2N+E, red);
dot("$N$", inter[1], S+2E, red);



Étiquettes : , , ,

## Asymptote using geometry.asy – fig0380

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 19 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(10cm);

// currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-0.25,.75));
// show(currentcoordsys);

// Enlarge the bounding box of the current picture
draw(box((-6,-5), (10,2)), invisible);

point A=(-2,-2);
point B=(2,-3);
dot("$A$",A,N,red);
dot("$B$",B,S,red);

line l=line(A,B);
draw(l);

point C=(2,-1.5);
dot("$C$",C,N);

hyperbola h=hyperbola(C,sqrt(2),sqrt(2)/2,0);
draw(h);

/* View the definition of point[] intersectionpoints(line,hyperbola) */
point[] inter=intersectionpoints(l,h);
dot("$M$", inter[0], 2N+E, red);
dot("$N$", inter[1], 2S+E, red);



Étiquettes : , , ,

## Asymptote using geometry.asy – fig0390

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 20 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;

size(8cm,0);

currentcoordsys=cartesiansystem((0,0),i=(1,1),j=(-0.5,.75));
show(currentcoordsys);

point A=(-0.5,.75);
point B=(1,1);
dot("$A$",A,SE);
dot("$B$",B,NW);

line l=line(A,B,false);
line ll=hline()+B;

circle c=circle((point)(0.5,0.5),2);
draw(l^^ll);
draw(complementary(l),dashed+grey);
draw(c);

dotfactor*=2;

/* View the definition of point[] intersectionpoints(line,circle) */
dot(intersectionpoints(l,c),red);
dot(intersectionpoints(ll,c),red);



Étiquettes : , , ,

## Asymptote using geometry.asy – fig0400

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 21 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;

size(8cm,0);

currentcoordsys=cartesiansystem((0,0),i=(1,1),j=(-0.5,.75));
show(currentcoordsys);

point A=(-0.5,.75);
point B=(1,1);
dot("$A$",A,SE);
dot("$B$",B,NW);

line l=line(A,B,false);
line ll=hline()+B;

ellipse el=ellipse((point)(0.5,0.5),3,2);
draw(l^^ll);
draw(complementary(l),dashed+grey);
draw(el);

dotfactor*=2;

/* View the definition of point[] intersectionpoints(line,ellipse) */
dot(intersectionpoints(l,el),red);
dot(intersectionpoints(ll,el),red);



Étiquettes : , , ,

## Asymptote using geometry.asy – fig0410

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 22 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(10cm);

// currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-0.25,.75));
// show(currentcoordsys);

point A=(-1,-1);
point B=(2,1);
dot("$A$",A,S,red);
dot("$B$",B,NW,red);

line l=line(A,B,false);
line ll=hline()+0.5*B;
draw(l^^ll);
draw(complementary(l),dashed+grey);

point F=(2,-1.5);
dot("$F$",F,N);

parabola p=parabola(F,0.2,110);
draw(p);

dotfactor*=2;

/* View the definition of point[] intersectionpoints(line,parabola) */
dot(intersectionpoints(l,p), red);
dot(intersectionpoints(ll,p), red);



Étiquettes : , , ,

## Asymptote using geometry.asy – fig0420

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 23 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(10cm,0);

// currentcoordsys=cartesiansystem((0,0),i=(1,1),j=(-0.5,.75));
// show(currentcoordsys);

point A=(-1,-1);
point B=(0.75,0.5);
dot("$A$",A,NW,red);
dot("$B$",B,N,red);

circle c1=circle(A,1.5);
circle c2=circle(B,2);
draw(c1^^c2);

/* View the definition of line radicalline(circle,circle) */
/* View the definition of point radicalcenter(circle,circle) */

dotfactor*=2;

/* View the definition of point[] intersectionpoints(circle,circle) */
point[] inter=intersectionpoints(c1,c2);
dot("$M$", inter[0], 2SW, red);
dot("$N$", inter[1], 2NE, red);



Étiquettes : , , ,

## Asymptote using geometry.asy – fig0440

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 1 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(10cm,0);

// currentcoordsys=cartesiansystem((0,0),i=(1,0.25),j=(-0.5,.75));
show(currentcoordsys, xpen=invisible);

point A=(-1,-1);
point B=(0.75,0.5);
dot("$A$",A,NW,red);
dot("$B$",B,N,red);

circle c1=circle(A,1.5);
circle c2=circle(B,2);
draw(c1^^c2);

point[] inter=intersectionpoints(c1,c2);
dot("$M$", inter[0], 2NW, red);

/* View the definition of line tangent(circle,point) */
draw(tangent(c1,inter[0]), grey);
draw(tangent(c2,inter[0]), grey);

/* View the definition of line tangent(circle,abscissa) */
draw(tangent(c2,angabscissa(135)), grey);



Étiquettes : , , , ,

## Asymptote using geometry.asy – fig0450

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 2 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(10cm,0);

point c2=(13,5);
real r=4, R=abs(c2)-r;

circle[] C={circle(origin, 4), circle(c2,R)};
draw(C[0]^^C[1], blue);

segment s=segment(origin, c2);
draw(s, red, dot);

/* View the definition of point curpoint(line,real) */
point T=curpoint(s,r/(r-R)*abs(c2));
dot(T);
/* View the definition of line tangents(circle,point) */
line[] tgt=tangents(C[1], T);
draw(tgt);

point[][] t= new point[2][2];
for (int i=0; i < 2 ; ++i)
for (int j=0; j < 2; ++j) {
/* View the definition of point[] intersectionpoints(line,circle) */
t[i][j]=intersectionpoints(C[i],tgt[j])[0];
draw(C[i].C--t[i][j], dot);
markrightangle(T, t[i][j], C[i].C, size=(i == 0 ? 2mm : 0));
}



Étiquettes : , , , , ,

## Asymptote using geometry.asy – fig0460

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 3 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(10cm,0);

// currentcoordsys=cartesiansystem((0,0),i=(1,0.5),j=(-0.5,.75));
show(currentcoordsys, xpen=invisible);

point A=(-1,-1);
point B=(0.75,0.5);
dot("$A$",A,NW,red);
dot("$B$",B,N,red);

ellipse el1=ellipse(A,2,1.5);
ellipse el2=ellipse(B,3,2);
draw(el1);
draw(el2,Arrow);

point[] inter=intersectionpoints(el1,el2);
dot("$M$", inter[0], 2NW, red);

/* View the definition of line[] tangents(ellipse,point) */
draw(tangents(el1,inter[0]), grey);
draw(tangents(el2,inter[0]), grey);

/* View the definition of line tangent(ellipse,abscissa) */
draw(tangent(el2,angabscissa(90)), grey);



Étiquettes : , , , , , ,

## Asymptote using geometry.asy – fig0470

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 4 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(12cm);

// currentcoordsys=cartesiansystem((0,0),i=(1,0.5),j=(-0.5,.75));
// show(currentcoordsys, xpen=invisible);

point F1=(0,0);
dot("$F1$",F1,NW);
point F2=(-0.25,0.5);
dot("$F2$",F2,SE);

parabola p=parabola(F1, 0.1, 120);
draw(p, bp+red);

parabola pp=parabola(F2, 0.06, 280);
draw(pp, bp+blue);

abscissa x=angabscissa(180);
dot(point(p,x));
/* View the definition of line tangent(parabola,abscissa) */
draw(tangent(p,x), 0.8*red);

point[] P=intersectionpoints(p,pp);
dot(P);

/* View the definition of line[] tangents(parabola,point) */
draw(tangents(p,P[0]), 0.8*red);
draw(tangents(pp,P[0]), 0.8*blue);

// Enlarge the bounding box
draw(box((-1,-0.4), (0.5,0.6)),invisible);



Étiquettes : , , , , , ,

## Asymptote using geometry.asy – fig0480

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 5 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(10cm);

point C=(4,2);
dot("$C$",C,E+NE,red);

hyperbola h=hyperbola(C,1.5,1,-20);
draw(h, linewidth(bp));

/* View the definition of line tangent(hyperbola,abscissa) */
line l=tangent(h,angabscissa(85));
draw(l, grey);
dot(intersectionpoints(h,l));

l=tangent(h,angabscissa(0,fromCenter));
draw(l, grey);
dot(intersectionpoints(h,l));

// Enlarge the bounding box of the current picture.
draw(box((-1,-0.5), (9,4)), invisible);



Étiquettes : , , , , , ,

## Asymptote using geometry.asy – fig0490

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 6 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(12cm);

point C=(0,0);
dot(C);

hyperbola[] h;
h[0]=hyperbola(C,2,2);
h[1]=hyperbola(C,1.5,1);

draw(h[0], 2bp+0.8*red);
draw(h[1], 2bp+0.8*blue);

point[] P=intersectionpoints(h[0],h[1]);

line[] l;
for (int i=0; i < P.length; ++i) {
for (int j=0; j < 2; ++j) {
/* View the definition of line[] tangents(hyperbola,point) */
l=tangents(h[j],P[i]);
draw(l[0], j == 0 ? red : blue);
}
}

dot(P, yellow);

// Enlarge the bounding box of the current picture.
draw(box((-4,-3), (4,3)), invisible);



Étiquettes : , , , , ,

## Asymptote using geometry.asy – fig0500

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 7 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(10cm,0);

currentcoordsys=cartesiansystem((0,0),i=(1,0.5),j=(-0.5,.75));
show(currentcoordsys, xpen=invisible);

point A=(2.5,-1);
point B=A+(3,1);
dot("$A$",A,SW);
dot("$B$",B,2N+0.5W);

circle c1=circle(A,1.5);
draw(c1);

/* View the definition of line[] tangents(circle,point) */
line[] tgt=tangents(c1,B);
draw(tgt,red);
/* View the definition of circle circle(point,point) */
draw(circle(B,A),grey);

// dot(intersectionpoints(c1,circle(B,A)),red);
for (int i=0; i<tgt.length; ++i) {
dot(intersectionpoints(c1,tgt[i]),2mm+red);
}



Étiquettes : , , , , ,

## Asymptote using geometry.asy – fig0510

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 8 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(12cm,0);

// currentcoordsys=cartesiansystem((0,0),i=(1,0.5),j=(-0.5,.75));
// show(currentcoordsys, xpen=invisible);

point A=(2.5,-1);
dot("$A$",A,SW);
ellipse el1=ellipse(A,2,1,10);
draw(el1);

circle C=circle(A,3);
draw(C);
for (int i=0; i < 360; i+=90) {

point B=point(C,angabscissa(i));
dot("$B$",B,locate(unit(B-A)));

line[] tgt=tangents(el1,B);
draw(tgt,0.8*red);

for (int i=0; i < tgt.length; ++i) {
dot(intersectionpoints(el1,tgt[i]),blue);
}

}



Étiquettes : , , , , , ,

## Asymptote using geometry.asy – fig0520

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 9 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(12cm,0);

// currentcoordsys=cartesiansystem((0,0),i=(1,0.5),j=(-0.5,.75));
// show(currentcoordsys, xpen=invisible);

point F=(0,0);
dot("$F$", F, SW);
parabola p=parabola(F, 0.1, 30);
draw(p);

point C=shift(2*(p.V-p.F))*p.V;
circle cle=circle(C, 0.2);
draw(cle);
for (int i=0; i < 360; i+=90) {

point M=point(cle, angabscissa(i));
dot("$M$", M, locate(unit(M-C)));

line[] tgt=tangents(p, M);
draw(tgt, 0.8*red);

for (int i=0; i < tgt.length; ++i) {
dot(intersectionpoints(p, tgt[i]), blue);
}
}



Étiquettes : , , , , , ,

## Asymptote using geometry.asy – fig0560

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 13 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(10cm,0);

// currentcoordsys=cartesiansystem((0,0),i=(1,0.5),j=(-0.5,.75));
// show(currentcoordsys, xpen=invisible);

point A=(0,0), B=(2,1);

line l=line(A,B);
draw(l);
show(l, blue);

/* View the definition of point relpoint(line,real) */
point P=relpoint(l, 1);
dot("relpoint(l, 1)", P, 2E,linewidth(2mm));
/* View the definition of abscissa relabscissa(line,point) */
dot(point(l,relabscissa(l,P)), red);

/* View the definition of point curpoint(line,real) */
point P=curpoint(l, 1);
dot("curpoint(l, 1)", P, SE, blue+2mm);
/* View the definition of abscissa curabscissa(line,point) */
dot(point(l,curabscissa(l,P)), yellow);

point P=relpoint(l, 2);
dot("relpoint(l, 2)", P, NW,linewidth(2mm));
dot(point(l,relabscissa(l,P)), red);

point P=curpoint(l, 2);
dot("curpoint(l, 2)", P, NW, blue+2mm);
dot(point(l,curabscissa(l,P)), yellow);



Étiquettes : , , ,

## Asymptote using geometry.asy – fig0960

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 5 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(8cm);

// currentcoordsys=cartesiansystem((1,2),i=(1,0.5),j=(-0.5,.75));
show(currentcoordsys, xpen=invisible);

point A=(-1,0) ; dot("$A$",A,S);
point B=(1,1)  ; dot("$B$",B,S);
point C=(0,0)  ;
point D=(1,-1) ; dot("$D$",D,SW);

arc c=arc(circle(C,2), 0, 270);
draw(complementary(c),dashed+grey);

line l1=line(A,B); draw(l1);
line l2=line(C,D); draw(l2);

point[] J=intersectionpoints(l1,c);
point[] K=intersectionpoints(l2,c);

/* View the definition of arc arc(explicit arc,point,point) */
draw(arc(c,K[0],J[0]),2mm+0.8yellow);
draw(arc(c,J[1],K[0]),2mm+0.8red);
/* View the definition of arc arc(explicit arc,abscissa,abscissa) */
draw(arc(c,relabscissa(c,J[0]),relabscissa(1)),2mm+0.8green);
draw(arc(c,relabscissa(0),relabscissa(c,J[1])),2mm+0.8blue);

dot("$J_0$",J[0],2NW);
dot("$J_1$",J[1],2N);
dot("$K_0$",K[0],2W);

draw(c, 1mm+white);



Étiquettes : , , , , , ,

## Asymptote using geometry.asy – fig0970

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 6 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(8cm);

// currentcoordsys=cartesiansystem((1,2),i=(1,0.5),j=(-0.5,.75));
show(currentcoordsys, xpen=invisible);

point A=(-1,0) ; dot("$A$",A,S);
point B=(1,1)  ; dot("$B$",B,S);
point C=(0,0)  ;
point D=(1,-1) ; dot("$D$",D,SW);

arc c=arc(ellipse(C,2,1,20), 0, 270);
draw(complementary(c),dashed+grey);

line l1=line(A,B); draw(l1);
line l2=line(C,D); draw(l2);

point[] J=intersectionpoints(l1,c);
point[] K=intersectionpoints(l2,c);

/* View the definition of arc arc(explicit arc,point,point) */
draw(arc(c,J[0],K[0]),2mm+0.8yellow);
draw(arc(c,K[0],J[1]),2mm+0.8red);
/* View the definition of arc arc(explicit arc,abscissa,abscissa) */
draw(arc(c,relabscissa(c,J[1]),relabscissa(1)),2mm+0.8green);
draw(arc(c,relabscissa(0),relabscissa(c,J[0])),2mm+0.8blue);

dot("$J_0$",J[0],2N);
dot("$J_1$",J[1],N+2W);
dot("$K_0$",K[0],2N);

draw(c, 1mm+white);



Étiquettes : , , , , , ,

## Asymptote using geometry.asy – fig1010

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 10 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(8cm,0);

currentcoordsys=cartesiansystem((1,2),i=(1,0.5),j=(-0.5,.75));
show(currentcoordsys, xpen=invisible);

real R=2;

point A=(1,1);
dot("$A$", A, S, red);
point B=A+(2,1);
dot("$B$", B, N, blue);

arc a=arc(circle(A,R), -40, 180);
arc b=arc(circle(B,R), -45, 220);
line l=line(A,B);

draw(a,red);
draw(b,blue);
draw(l);

/* View the definition of point[] intersectionpoints(arc,arc) */
point[] inter=intersectionpoints(a,b);
dot(inter);

/* View the definition of point[] intersectionpoints(line,arc) */
point[] inter=intersectionpoints(l,a);
dot(inter);

point[] inter=intersectionpoints(l,b);
dot(inter);



Étiquettes : , , , , ,

## Asymptote using geometry.asy – fig1020

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 11 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(8cm,0);

// currentcoordsys=cartesiansystem((1,2),i=(1,0.5),j=(-0.5,.75));
// show(currentcoordsys, xpen=invisible);

real R=2;

point A=(1,1);
dot("$A$", A, S, red);
point B=A+(2,1);
dot("$B$", B, N, blue);

arc a=arc(ellipse(A,R,R/2), -40, 180);
arc b=arc(ellipse(B,R,R/2), -45, 220);

line l=line(A,B);

draw(a,red);
draw(b,blue);
draw(l);

/* View the definition of point[] intersectionpoints(arc,arc) */
point[] inter=intersectionpoints(a,b);
dot(inter);

/* View the definition of point[] intersectionpoints(line,arc) */
point[] inter=intersectionpoints(l,a);
dot(inter);

point[] inter=intersectionpoints(l,b);
dot(inter);



Étiquettes : , , , , ,

## Asymptote using geometry.asy – fig1030

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 12 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(8cm,0);

currentcoordsys=cartesiansystem((1,2),i=(1,0.5),j=(-0.5,.75));
show(currentcoordsys, xpen=invisible);

real R=2;

point A=(1,1.5);
dot("$A$",A,S,red);
point B=A+(2,1);
dot("$B$",B,S,blue);

arc a=arc(circle(A,R),-40,180);
arc b=arc(circle(B,R),-45,220);

draw(a,red);
draw(b,blue);

point M=intersectionpoints(a,b)[0];
dot(M);

/* View the definition of line tangent(explicit arc,point) */
draw(tangent(a,M), grey);
draw(tangent(b,M), grey);

/* View the definition of line tangent(explicit arc,abscissa) */
draw(tangent(a,angabscissa(45)), grey);



Étiquettes : , , , , , ,

## Asymptote using geometry.asy – fig1040

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 13 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(10cm,0);

// currentcoordsys=cartesiansystem((1,2),i=(1,0.5),j=(-0.5,.75));
// show(currentcoordsys, xpen=invisible);

real R=2;

point A=(1,1.5);
dot("$A$",A,S,red);
point B=A+(2.5,1);
dot("$B$",B,E,blue);

arc a=arc(ellipse(A,R,R/2,30),-40,180);
// ellispenodesnumberfactor=400;
arc b=arc(ellipse(B,2R,R/2,-10),-30,180);

draw(a,red);
draw(b,blue);

point M=intersectionpoints(a,b)[0];
dot(M);

/* View the definition of line tangent(explicit arc,point) */
draw(tangent(a,M), grey);
draw(tangent(b,M), grey);

/* View the definition of line tangent(explicit arc,abscissa) */
draw(tangent(a,angabscissa(45)), grey);



Étiquettes : , , , , , ,

## Asymptote using geometry.asy – fig1050

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 14 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(8cm,0);

// currentcoordsys=cartesiansystem((1,2),i=(1,0.5),j=(-0.5,.75));
// show(currentcoordsys, xpen=invisible);

point A=(0.25,0.25);
point B=A+(1,0.25);
dot("$A$",A,S,red);
dot("$B$",B,N,red);

segment s=segment(A,B);
line bis=bisector(s);

draw(s,StickIntervalMarker(2,2));
draw(bis);

/* View the definition of path compassmark(pair,pair,real,real) */
draw(compassmark(A, point(bis,0.75), position=0.25,angle=25), grey);
draw(compassmark(B, point(bis,0.75), position=0.75,angle=25), grey);

/* View the definition of point point(line,real) */
draw(compassmark(A, point(bis,0.25), position=0.5,angle=15), grey);
draw(compassmark(B, point(bis,0.25), position=0.5,angle=15), grey);



Étiquettes : , , , , ,

## Asymptote using geometry.asy – fig1110

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 20 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(10cm,0);

// currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-0.25,0.75));
// show(currentcoordsys);

triangle t=triangle((-1,0), (2,0), (0,2));

/* View the definition of void drawline(picture,triangle,pen) */
drawline(t, linewidth(bp));
/* View the definition of void label(picture,Label,Label,Label,triangle,real,real,pen,filltype) */
label(t,alignFactor=4);

/* View the definition of circle circle(triangle) */
circle cc=circle(t);
draw(cc, 0.8blue);
dot(cc.C, blue);
/* View the definition of triangle tangential(triangle) */
triangle tgt=tangential(t);
draw(tgt, bp+0.8blue);
label("$A_1$", "$B_1$", "$C_1$", tgt, blue);

/* View the definition of circle incircle(triangle) */
circle ic=incircle(t);
draw(ic, 0.8red);
dot(ic.C, red);
triangle intouch=intouch(t);
draw(intouch, bp+0.8red);
label("$A_2$", "$B_2$", "$C_2$", intouch, red);

/* View the definition of circle excircle(side,triangle) */
circle ec=excircle(t.AB);
clipdraw(ec, 0.8green);
dot(ec.C, green);

ec=excircle(t.AC);
clipdraw(ec, 0.8green);
dot(ec.C, green);

ec=excircle(t.BC);
clipdraw(ec, 0.8green);
dot(ec.C, green);

/* View the definition of triangle extouch(triangle) */
triangle ext=extouch(t);
draw(ext, bp+0.8green);
label("$A_3$", "$B_3$", "$C_3$", ext, green);

/* View the definition of point extouch(side) */
dot(extouch(t.AB), 0.8*green);
dot(extouch(t.BC), 0.8*green);
dot(extouch(t.CA), 0.8*green);

/* View the definition of point intouch(side) */
dot(intouch(t.AB), 0.8*red);
dot(intouch(t.BC), 0.8*red);
dot(intouch(t.CA), 0.8*red);

// Enlarge the bounding box of the current picture
draw(box((-2.5,-3), (3.5,3.5)), invisible);



Étiquettes : , , , , , ,

## Asymptote using geometry.asy – fig1120

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 21 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(10cm,0);

// currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-0.25,0.75));
// show(currentcoordsys);

triangle t=triangle((-1,0), (2,0), (0,2));

drawline(t, linewidth(bp));
label(t,alignFactor=2, alignAngle=90);

/* View the definition of triangle symmedial(triangle) */
triangle st=symmedial(t);
draw(st, bp+0.8green);
label("$A'$", "$B'$", "$C'$", st, alignAngle=45, 0.8green);

/* View the definition of line median(vertex) */
line mA=median(t.VA);
draw(mA, blue);
dot("$M_A$",midpoint(t.BC), 1.5E, blue);
draw(segment(t.BC), bp+blue, StickIntervalMarker(2,2,blue));

/* View the definition of line bisector(vertex,real) */
line bA=bisector(t.VA);
draw(bA, grey);
/* View the definition of point bisectorpoint(side) */
dot("$B_A$", bisectorpoint(t.BC));

/* View the definition of line symmedian(vertex) */
line sA=symmedian(t.VA);
draw(sA, 0.8*green);

draw(symmedian(t.VB), 0.8*green);
draw(symmedian(t.VC), 0.8*green);

/* View the definition of point symmedian(triangle) */
point sP=symmedian(t);
dot(sP);



Étiquettes : , , , , ,

## Asymptote using geometry.asy – fig1130

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 22 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(8cm,0);

// currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-0.25,0.75));
// show(currentcoordsys);

triangle t=rotate(-20)*triangle((-1,0), (2,0), (0,2));
drawline(t, linewidth(bp));
label(t,alignFactor=4);

line bab=bisector(t.AB);
draw(bab, blue);
perpendicularmark(t.AB,bab,quarter=4);

line bac=bisector(t.AC);
draw(bac, blue);
perpendicularmark(t.AC,bac,quarter=4);

line bbc=bisector(t.BC);
draw(bbc, blue);
perpendicularmark(t.BC,bbc,quarter=4);



Étiquettes : , , , , ,

## Asymptote using geometry.asy – fig1140

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 23 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(8cm,0);

// currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-0.25,0.75));
// show(currentcoordsys);

triangle t=rotate(-20)*triangle((-1,0), (2,0), (0,2));
drawline(t, linewidth(bp));
label(t, alignAngle=90, alignFactor=2);

/* View the definition of point incenter(triangle) */
point incenter=incenter(t);

line ba=bisector(t.VA);
draw(ba, blue);
markangle((line) t.AB, (line) t.AC,StickIntervalMarker(i=2,n=1));

line bb=bisector(t.VB);
draw(bb, blue);
markangle((line) t.BC, (line) t.BA, radius=2cm, StickIntervalMarker(i=2,n=2));

line bc=bisector(t.VC);
draw(bc, blue);
markangle((line) t.CA, (line) t.CB, radius=1.5cm, StickIntervalMarker(i=2,n=3));



Étiquettes : , , , ,

## Asymptote using geometry.asy – fig1150

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 0 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

import geometry;
size(8cm);

// currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-0.25,.75));
// show(currentcoordsys);

dotfactor *=1.5;
triangle t=triangleabc(3,4,5);
drawline(t, linewidth(bp));
label(t, alignFactor=3);

line l=line((-1,-2), (1,0.5));
draw(l, 0.8*red);
/* View the definition of point[] intersectionpoints(triangle,line,bool) */
dot(intersectionpoints(t,l), 0.8*red);

circle C=2*circle(t);
draw(C, 0.8*blue);
/* View the definition of point[] intersectionpoints(triangle,conic,bool) */
dot(intersectionpoints(t,C, true), 0.8*blue);



Étiquettes : , , , ,

## Asymptote using geometry.asy – fig1160

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 1 h 02 min

 (Compiled with Asymptote version 2.14svn-r5318)

unitsize(1cm);
import geometry;

point pA = (0,0);
point pB = (5,0);
point pC = (5,5);

dot(pA^^pB^^pC);
draw(pA--pB--pC--cycle);

distance(Label("$x \; \mathrm{cm}$",align=S),pA,pB,3mm);
distance(Label("$y \; \mathrm{cm}$",align=E),pB,pC,3mm);
distance(Label("$z \; \mathrm{cm}$",align=I*dir(pA--pC)),pA,pC,-3mm);

shipout(bbox(xmargin=1mm,invisible));



Étiquettes : , , , , , ,

## Asymptote using geometry.asy – fig1170

Category: Asymptote,Examples 2D,geometry.asyPh. Ivaldi @ 2 h 02 min

 (Compiled with Asymptote version 1.92svn-r4817)

import geometry; size(8cm);

inversion inv=inversion(1,(-4.5,0));
path g1=inv*line((-1,0),(-1,1)),
g2=inv*line((1,0),(1,1));
fill(g1,lightgrey); draw(g1,linewidth(bp));
unfill(g2); draw(g2,linewidth(bp));

int n=40;
for (int i=-n; i <= n; ++i) {
path g=inv*circle((point) (0,2*i),1);
fill(g,(1-abs(i)/n)*yellow);
draw(g,bp+red); draw(g,blue);
}
shipout(bbox(5mm,Fill(rgb(0.95,0.95,0.8))));



Étiquettes : , , , , ,

## Asymptote using trembling.asy – fig0070

Category: Asymptote,Examples 2D,trembling.asyPh. Ivaldi @ 8 h 24 min

 (Compiled with Asymptote version 1.87svn-r4652)

import trembling;
startTrembling(angle=6, frequency=1, random=10);

size(8cm);

triangle T=triangleabc(6,6,6);

draw(T, dot);
draw(bisector(T.AB)^^bisector(T.AC)^^bisector(T.BC), 0.8*red);



Étiquettes : , , , ,

## Asymptote using trembling.asy – fig0080

Category: Asymptote,Examples 2D,trembling.asyPh. Ivaldi @ 9 h 24 min

 (Compiled with Asymptote version 1.87svn-r4652)

import trembling;
startTrembling(angle=6, frequency=1);

size(8cm);

triangle T=triangleabc(6,6,6);
magnetize(centroid(T));/* View the definition of void magnetize(...pair[]) */
magnetize(T);

draw(T, dot);
draw(bisector(T.AB)^^bisector(T.AC)^^bisector(T.BC), 0.8*red);



Étiquettes : , , , , ,

## Asymptote using trembling.asy – fig0100

Category: Asymptote,Examples 2D,trembling.asyPh. Ivaldi @ 11 h 24 min

 Note that the makers are also deformed... (Compiled with Asymptote version 1.87svn-r4652)

import trembling;
size(12cm);
startTrembling();

currentcoordsys=cartesiansystem((2,1),i=(1,0.5),j=(-0.25,1));
show(currentcoordsys);

point A=(1,1);
line l1=line(45,A);
dot("$A$",A);
draw("$(l_1)$",l1);

point B=(3,1);
line l2=line(-60,B);
dot("$B$",B);
draw("$(l_2)$",l2);

markangle(2,l2,l1,0.8*green,StickIntervalMarker(i=1,n=2));

l2,l1,0.8*blue);

markangle(reverse(l2),reverse(l1),Arrow,StickIntervalMarker(i=1,n=2));

markangle((string) sharpdegrees(l2,l1),
reverse(l2),l1,Arrow,red);



Étiquettes : , ,

## Asymptote using trembling.asy – fig0110

Category: Asymptote,Examples 2D,trembling.asyPh. Ivaldi @ 12 h 24 min

 With magnetizePoints=false. (Compiled with Asymptote version 1.87svn-r4652)

import trembling;
startTrembling(magnetizePoints=false);

size(12cm,0);

point A=(0,0), B=(5,2), C=(3,4);

triangle t=triangle(A,B,C),
et1=triangle(A,B,rotate(-60,A)*B),
et2=triangle(B,C,rotate(-60,B)*C),
et3=triangle(C,A,rotate(-60,C)*A);

draw(et1^^et2^^et3, 0.8*red);
dot(et1.Path()^^et2.Path()^^et3.Path());
draw(t); label(t, alignFactor=2.5);

point[] F=fermat(t);
dot("$F_1$",F[0], S, red);
dot("$F_2$",F[1], W, purple);

draw(circle(et1)^^circle(et2)^^circle(et3), 0.8*green);

draw(line(C,et1.C)^^line(A,et2.C)^^line(B,et3.C), 0.8*blue);
label("$N_1$",et1.VC);
label("$N_2$",et2.VC);
label("$N_3$",et3.VC);



Étiquettes : , , , , , ,

## Asymptote using trembling.asy – fig0120

Category: Asymptote,Examples 2D,trembling.asyPh. Ivaldi @ 13 h 24 min

 The same code with magnetizePoints=true. (Compiled with Asymptote version 1.87svn-r4652)

import trembling;
startTrembling();

size(12cm,0);

point A=(0,0), B=(5,2), C=(3,4);

triangle t=triangle(A,B,C),
et1=triangle(A,B,rotate(-60,A)*B),
et2=triangle(B,C,rotate(-60,B)*C),
et3=triangle(C,A,rotate(-60,C)*A);

draw(et1^^et2^^et3, 0.8*red);
dot(et1.Path()^^et2.Path()^^et3.Path());
draw(t); label(t, alignFactor=2.5);

point[] F=fermat(t);
dot("$F_1$",F[0], S, red);
dot("$F_2$",F[1], W, purple);

draw(circle(et1)^^circle(et2)^^circle(et3), 0.8*green);

draw(line(C,et1.C)^^line(A,et2.C)^^line(B,et3.C), 0.8*blue);
label("$N_1$",et1.VC);
label("$N_2$",et2.VC);
label("$N_3$",et3.VC);



Étiquettes : , , , , , ,

## Asymptote using trembling.asy – fig0130

Category: Asymptote,Examples 2D,trembling.asyPh. Ivaldi @ 14 h 24 min

 (Compiled with Asymptote version 1.87svn-r4652)

import trembling;
size(12cm);

startTrembling();

conic co[];
co[0]=circle((0,0),1);
draw(co[0]);

co[1]=ellipse((0,0),4,1);
draw(co[1]);

co[2]=parabola((0,0),1,90);
draw(co[2]);

hyperbola h=hyperbola((-1,0),(1,0),1.2,byvertices);
co[3]=h;
draw(co[3]);
draw(h.A1,grey);

draw(h.A2,grey);

dotfactor *= 1;

for (int i=0; i < 4; ++i) {
dot(intersectionpoints(h.A1,co[i]),blue);
dot(intersectionpoints(h.A2,co[i]),blue);
for (int j=i+1; j < 4; ++j)
dot(intersectionpoints(co[i],co[j]), red);
}



Étiquettes : , , , , , , , , , ,

## Unofficial package base_pi.asy – fig0190

Category: Asymptote,base_pi.asy,Unofficial packagesPh. Ivaldi @ 23 h 47 min

 (Compiled with Asymptote version 2.14svn-r5318)

import base_pi;
size(10cm,0);

pair O=(0,0);
path cle=rotate(30)*polygon(3);
pair a=point(cle,0),
b=point(cle,1),
c=point(cle,2);

/* View the definition of void drawline(picture,Label,pair,bool,pair,bool,align,pen,arrowbar,arrowbar,margin,Label,marker) */
drawline(O,false,a,true,.8red);
drawline(O,true,b,false,.8blue);
drawline(Label("$(d)$",Relative(.1)),O,true,c,true,.8green,Margin(5,5));

drawline(a,b);
drawline(b,c);
/* View the definition of void drawline(picture,Label,path,bool,bool,align,pen,arrowbar,arrowbar,margin,Label,marker) */
drawline(c--a);

dot("$O$",O,W);
dot("$A$",a,N);dot("$B$",b,NE);dot("$C$",c,SE);
// Enlarge the current picture bounding box (note that is can be differed at the end).
draw(box(-2a-(0,2b.y),2a+(0,2b.y)),invisible);



É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 : , ,