Asymptote Generalities – fig1780

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

Figure 0177
(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

Figure 0178
(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

Figure 0179
(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

Figure 0180
(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 – fig0010

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

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

/* View the definition of struct coordsys */
show(currentcoordsys);

pair a=(0,0.5), b=(1,0.5);
/* View the definition of struct point */
point A=a, B=b;

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

Étiquettes : , , ,


Asymptote using geometry.asy – fig0020

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

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

show(currentcoordsys);

pair a=(0,0.5), b=(1,0.5);
point A=a, B=b;

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

/* View the definition of coordsys cartesiansystem(pair,pair,pair) */
currentcoordsys=cartesiansystem((0.5,0.5), i=(0.7,0.7), j=(-0.7,0.7));
show("$O'$", "$\vec{u'}$", "$\vec{v'}$", currentcoordsys, xpen=invisible);

point Ap=a;
/* View the definition of point point(coordsys,explicit point) */
point Bp=point(currentcoordsys,B); // same as 'point Bp=b;'

dot("$A'$",Ap);
dot("$B'$",Bp);
dot("$M$",(Ap+Bp)/2);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0030

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

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

show(currentcoordsys);

pair a=(0,0.5), b=(1,0.5);
point A=a, B=b;

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

/* View the definition of coordsys cartesiansystem(pair,pair,pair) */
currentcoordsys=cartesiansystem((0.5,0.5), i=(0.7,0.7), j=(-0.7,0.7));
show("$O'$", "$\vec{u'}$", "$\vec{v'}$", currentcoordsys, xpen=invisible);

point Ap=a;
/* View the definition of point point(coordsys,explicit point,real) */
point Bp=point(currentcoordsys,B); // same as 'point Bp=b;'

dot("$A'$",Ap);
dot("$B'$",Bp);
dot("$M$",(Ap+Bp)/2);

draw(Ap--Bp);

/* View the definition of point locate(pair) */
draw(locate((0,0))--Bp,blue);

/* View the definition of pair locate(point) */
draw((0,0)--locate(Bp),0.8*green);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0040

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

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

coordsys R=defaultcoordsys;
show(R);

coordsys Rp=cartesiansystem((0.5,0.5), i=(0.35,0.35), j=(-0.35,0.35));
show("$O'$", "$\vec{\imath'}$", "$\vec{\jmath'}$", Rp, ipen=blue, xpen=invisible);

coordsys Rpp=cartesiansystem((-1,-0.5),
                                      i=rotate(-90)*(0.35,0.35),
                                      j=rotate(-90)*(-0.35,0.35));
show("$O''$", "$\vec{\imath''}$", "$\vec{\jmath''}$", Rpp, ipen=green, xpen=invisible);


pair m=(1,1);

/* View the definition of point point(coordsys,pair,real) */
dot("",point(R,m),red); // Same as 'dot("",m,red);'
dot("",point(Rp,m),blue);

point M=m;
/* View the definition of point point(coordsys,explicit point,real) */
dot("",point(Rpp,M),green); // Works also with 'point'

pair p=(-0.75,0.75);
point P=point(R,(-0.75,0.75));

dot("$P$",P,2E,4mm+red);

// There are two methods for changing
// the coordinate system of a point (or a pair)

/* View the definition of pair /(pair,coordsys) */
dot("$P'$",point(Rp,p/Rp),2S,3mm+blue); // Necessary for 'pair'
dot("$P'$",point(Rp,P/Rp),2N,3mm+blue); // but works with 'point' by casting.

/* View the definition of point changecoordsys(coordsys,point) */
dot("$P''$",changecoordsys(Rpp,P),2W,1.5mm+green); // Useful for 'point'.

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0050

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

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

currentcoordsys=cartesiansystem((1.25,0.75),i=(1,1),j=(-1,1));
coordsys Rp=currentcoordsys;
coordsys R=defaultcoordsys;

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

vector w=(0.125,0.5);
point P=(1,0.5);

dot("$P$",P);
draw(Label("$\overrightarrow{w}$",EndPoint), origin()--origin()+w, Arrow);
draw("$\overrightarrow{O'P}+\overrightarrow{w}$",
     origin()--P+w, Arrow);

dot("$M$",P+w,red);

/* View the definition of pair locate(explicit vector) */
draw("$\overrightarrow{w}$", (0,0)--locate(w), W,Arrow);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0060

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

Figure 0006
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(12cm,0);

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

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

vector w=(0.25,0.5);
point P=(1,0.5);

dot("$P$",P,W);
show("$\overrightarrow{w}$", w);

/* View the definition of transform rotateO(real) */
point Pp=rotateO(90)*P;

dot("Pp=rotateO(90)*P", Pp, W);

dot("rotate(90,Pp)*P", rotate(90,Pp)*P, W);
/* View the definition of transform scale(real,point) */
dot("scale(-2,Pp)*P", scale(-2,Pp)*P, NE);

/* View the definition of transform scaleO(real) */
dot("scaleO(2)*P", scaleO(2)*P,red);
/* View the definition of transform xscaleO(real) */
dot("xscaleO(2)*P", xscaleO(2)*P);
/* View the definition of transform yscaleO(real) */
dot("yscaleO(2)*P", yscaleO(2)*P,W);

vector wp=rotateO(90)*w;

show("$\overrightarrow{w'}$", wp);

draw("$\overrightarrow{w}$", (0,0)--locate(w), W, Arrow);
draw("$\overrightarrow{w'}$", (0,0)--locate(wp), S, Arrow);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0070

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

Figure 0007
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(15cm);

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

point A=(2,2);
dot("A",A,SE);

point B=(3,1.5);
dot("B",B,SE);

point C=A+(4,2);
dot("C",C);

drawline(A,B,red);
drawline(A,C,blue);

/* View the definition of transform scale(real,point,point,point,point,bool) */
transform t=scale(2,A,B,A,C);
/* View the definition of transform projection(point,point,point,point,bool) */
transform proj=projection(A,B,A,C);

point M=(2,4);
point Mh=proj*M;
dot("$H_M$",Mh,SE);
dot("$M$",M);
point Mp=t*M;
dot("\small$scale(2,A,B,A,C)*M=M'$",Mp,W);
drawline(M,Mh);

point P=(1,-1);
point Ph=proj*P;
dot("$H_P$",Ph,NW);
drawline(P,Ph);
dot("$P$",P);

transform t=scale(-1,A,B,A,C);
point Pp=t*P;
dot("\small$P'=scale(-1,A,B,A,C)*P$",Pp);
draw(P--Pp);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0080

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

Figure 0008
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(10cm,0);

currentcoordsys=cartesiansystem((1.5,1.5),i=(1,0.5),j=(-1,1));
coordsys Rp=currentcoordsys;
coordsys Rs=cartesiansystem((-1.5,1.5),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 w=(0.75,1.5);
draw("$\overrightarrow{w}$",(0,0)--w,Arrow);

pair P=(1,1);
dot("$P$",P);
dot("$P$",point(Rp,P/Rp),N);
dot("$P$",point(Rs,P/Rs),S);

show("$\overrightarrow{w'}$", vector(w));
show("$\overrightarrow{w''}$", vector(Rs,w));

dot("$P'$",point(Rp,P));
dot("$P''$",point(Rs,P));

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0090

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

Figure 0009
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(10cm,0);

currentcoordsys=cartesiansystem((1.5,1.5),i=(1,0.5),j=(-1,1));
coordsys Rp=currentcoordsys;
coordsys Rs=cartesiansystem((-1.5,1.5),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 P=(1,1);
dot("$P$",P);

draw(format("$\vert OP\vert\simeq %.2f$",abs(P)),(0,0)--P,Arrows);

point Pp=P;
dot("$P'$",Pp);
vector wp=Pp;
show(format("$\vert O'P'\vert= %.2f$",abs(Pp)), wp, Arrows);

point Ps=point(Rs,P);
dot("$P''$",Ps,S);
vector ws=Ps;
show(format("$\vert O''P''\vert\simeq %.2f$",abs(Ps)), ws, Arrows);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0100

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

Figure 0010
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(10cm,0);

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

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

pair w=(1.5,0.75);
draw("$\overrightarrow{w}$",(0,0)--w,Arrow);

pair P=(1,-1);
dot("$P$",P);

show("$\overrightarrow{w'}$", vector(w));

dot("$P'$",point(Rp,P),N);

point Ip=I;
dot("$I'$",Ip,N);
dot("$I'*P'$",Ip*point(Rp,P),S);
dot("$I*P'$",I*point(Rp,P),N);

vector wp=Ip*vector(w);
show(Label("$I'*\overrightarrow{w'}$",EndPoint), wp);

vector foo=I*vector(w);
show("$I*\overrightarrow{w'}$", foo);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0110

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

Figure 0011
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(10cm,0);

currentcoordsys=cartesiansystem((1.5,1.5),i=(1,0.5),j=(-1,1));
coordsys Rp=currentcoordsys;
coordsys Rs=cartesiansystem((-1.5,1.5),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);

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

for (int i=0; i<n; ++i) {
  pen p=(i/n)*red;
  dot(point(R,R.polar(1,step*i)),p);
  dot(point(Rp,Rp.polar(1,step*i)),p);
  dot(point(Rs,Rs.polar(1,step*i)),p);
}

Étiquettes : , ,


Asymptote using geometry.asy – fig0120

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

Figure 0012
(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

Figure 0013
(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

Figure 0014
(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

Figure 0015
(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

Figure 0016
(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){
  pair bad=(i,l1.slope*i+l1.origin);
  point good=bad;
  draw(Label("bad",align=S),bad,linewidth(2bp));
  draw(Label(good @ l1 ? "good":"bad",align=W),good,linewidth(2bp));
}


Étiquettes : , , , ,


Asymptote using geometry.asy – fig0170

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

Figure 0017
(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

Figure 0018
(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

Figure 0019
(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

Figure 0020
(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

Figure 0021
(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);

markangleradiusfactor*=5;
/* 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));

markangle(2,radius=-0.5*markangleradius(),
          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),
          radius=-1.5*markangleradius(),
          reverse(l2),l1,Arrow,red);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0220

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

Figure 0022
(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);
markangleradiusfactor*=5;

/* 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));
markangle(2, reverse(l2), l1, radius=1.25*markangleradius(), StickIntervalMarker(2,1,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

Figure 0023
(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

Figure 0024
(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

Figure 0025
(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 – fig0260

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

Figure 0026
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;

size(5cm,0);

point M=(1,1);
point N=(0.25,0.28);
point P=(0.75,0.66);

path g=origin--M;
line l=line(origin,M);
pen p=linewidth(5mm);
draw(l,p);

dot(N,p+red);
dot(N,blue);

dot(P,p+red);
dot(P,blue);

draw(box(origin,(1,1)),invisible);

/* View the definition of bool @(point,line) */
write(N@l);// Return 'false'

/* View the definition of bool onpath(picture,path,point,pen) */
write(onpath(g,N,p));// Return 'true'
write(onpath(g,P,p));// Return 'false'

Étiquettes : , , ,


Asymptote using geometry.asy – fig0270

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

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

currentcoordsys=cartesiansystem((0,0),i=(1,1),j=(-0.5,.75));
show("","$\vec{u}$", "$\vec{v}$", currentcoordsys, ipen=blue);
show(defaultcoordsys);

point A=(0,0);

real R=2;
/* View the definition of struct circle */
circle C=circle(A,R);
draw(C,1.5mm+red);

circle Cp=circle(point(defaultcoordsys,A),R);
draw(Cp,0.75mm+blue);

// One can draw in the 'currentcoordsys' a circle definided in
// the 'defaultcoordsys'
/* View the definition of path *(coordsys,path) */
draw(currentcoordsys*Cp, red+blue);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0280

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

Figure 0028
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(10cm);

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

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

draw(line(A,B), linewidth(bp));
draw(line(A,C), linewidth(bp));
draw(line(B,C), linewidth(bp));

/* View the definition of circle circle(point,point,point) */
circle cc=circle(A,B,C);
draw(cc, blue);
dot(cc.C, blue);

/* View the definition of circle incircle(point,point,point) */
circle ic=incircle(A,B,C);
draw(ic, red);
dot(ic.C, red);


/* View the definition of circle excircle(point,point,point) */
circle ec=excircle(A,B,C);
/* View the definition of void clipdraw(picture,Label,path,align,pen,arrowbar,arrowbar,real,real,Label,marker) */
clipdraw(ec, green);
dot(ec.C, green);

ec=excircle(A,C,B);
clipdraw(ec, green);
dot(ec.C, green);

ec=excircle(C,B,A);
clipdraw(ec, green);
dot(ec.C, green);

dot("G",centroid(A,B,C),NE);

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

Étiquettes : , , ,


Asymptote using geometry.asy – fig0290

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

Figure 0029
(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,1);
dot("$A$",A,S,red);

real R=2;
circle C=circle(A,R);
draw(C,Arrow);

/* View the definition of ellipse *(transform,circle) */
ellipse el=xscale(2)*C;
draw(el,blue,Arrow);

// /* View the definition of transform xscale(real,point) */
ellipse el=xscale(2,A)*C;
draw(el,red,Arrow);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0300

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

Figure 0030
(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,1);
dot("$A$",A,S,red);

real R=2;
circle C=circle(A,R);
draw(C,Arrow);

/* View the definition of ellipse *(transform,circle) */
draw(scale(0.5)*C,red,Arrow);

draw(scale(0.5,A)*C,2mm+0.8*blue);

/* View the definition of circle /(explicit circle,real) */
draw(C/2,0.75mm+green,Arrow(4mm));

// Note that the point 'point(C,0)' is always at the same place relatively to 'C'.
draw(rotateO(180)*C/2,0.8*yellow,Arrow);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0310

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

Figure 0031
(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 A=(1,1);
dot("$A$",A,S,red);

real a=3, b=2;
ellipse el=ellipse(A,a,b,0);
draw(el,Arrow);

/* View the definition of ellipse *(transform,ellipse) */
draw(scale(0.5)*el,red,Arrow);

draw(scale(0.5,A)*el,2mm+0.8*blue);

/* View the definition of ellipse /(ellipse,real) */
draw(el/2,0.75mm+green,Arrow(4mm));

// Note that the point 'point(el,0)' is always at the same place relatively to 'el'.
draw(rotateO(135)*el/2,0.8*yellow,Arrow);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0320

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

Figure 0032
(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 F=(0.25,0.5);

dot("$F$",F,SW,red);

// Enlarge the bounding box of the current picture
draw(box(locate((-1.5,0)),locate((1,1))), invisible);

line l=rotateO(10)*line((0,-0.4),(1,-0.4));
draw(l);

/* View the definition of parabola parabola(point,line) */
parabola p=parabola(F,l);
draw(p,linewidth(3mm));

/* View the definition of parabola parabola(point,point) */
draw(parabola(p.F,p.V),2mm+red);

/* View the definition of parabola parabola(point,real,real) */
draw(parabola(p.F,p.a,p.angle),1mm+green);

Étiquettes : , ,


Asymptote using geometry.asy – fig0330

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

Figure 0033
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(10cm);

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

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

parabola p=parabola(F,0.2,90);

// Define the bounding box to draw the parabola.
// Try finalbounds(); to determine the final bounding box.
p.bmin=(-0.75,-0.4);
p.bmax=(2.75,0.75);

draw(box(p.bmin,p.bmax),red);

draw(p,dashed);/* Defered drawing to adjust the path to the final
                  bounding box.*/

draw((path)p,red); /* The path of 'p' is restricted to the box whose
                  the corners are p.bmin, p.bmax.*/


Étiquettes : , , , ,


Asymptote using geometry.asy – fig0340

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

Figure 0034
(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

Figure 0035
(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

Figure 0036
(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

Figure 0037
(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

Figure 0038
(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

Figure 0039
(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

Figure 0040
(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

Figure 0041
(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

Figure 0042
(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) */
draw(radicalline(c1,c2));
/* View the definition of point radicalcenter(circle,circle) */
dot(radicalcenter(c1,c2));

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

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

Figure 0043
(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 C=(0,0);
point Cp=(0.5,0.5);
dot("$C$",C,NW,red);
dot("$C'$",Cp,N,red);

ellipse el1=ellipse(C,2,1);
ellipse el2=ellipse(Cp,3,1,40);
draw(el1^^el2);

dotfactor*=2;

/* View the definition of point[] intersectionpoints(ellipse,ellipse) */
point[] inter=intersectionpoints(el1,el2);
dot(inter);

Étiquettes : , ,


Asymptote using geometry.asy – fig0440

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

Figure 0044
(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

Figure 0045
(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));
  }

addMargins(cm/2,cm/2);

Étiquettes : , , , , ,


Asymptote using geometry.asy – fig0460

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

Figure 0046
(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

Figure 0047
(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

Figure 0048
(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

Figure 0049
(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

Figure 0050
(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

Figure 0051
(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

Figure 0052
(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 – fig0530

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

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

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

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

/* View the definition of circle circle(point,point,point) */
circle c1=circle(A,B,C);
dot("$\Omega$",c1.C,N);
draw(c1);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0540

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

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

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

point A=(3.5,1),
B=(1.75,3),
C=(-1,2),
D=(-1.5,-0.5),
F=(1.5,-1);

dot("$A$",A);
dot("$B$",B,N);
dot("$C$",C,NW);
dot("$D$",D,SW);
dot("$F$",F,SE);

/* View the definition of ellipse ellipse(point,point,point,point,point) */
ellipse el=ellipse(A,B,C,D,F);
draw(el);

dot("$F_1$",el.F1,NW);
dot("$F_2$",el.F2,NW);

/* View the definition of coordsys canonicalcartesiansystem(ellipse) */
coordsys R=canonicalcartesiansystem(el);
show("$C$", "$\vec{u}$", "$\vec{v}$", R, xpen=blue);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0550

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

Figure 0055
(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);

// Enlarge the bounding box of the current picture
draw(box(locate((-1,-1.5)),locate((2,1))),invisible);

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

dot("$A$",A,SW,red);
dot("$B$",B,E,red);
dot("$C$",C,N,red);


line l=rotateO(20)*line((0,0),(1,0));
/* View the definition of parabola parabola(point,point,point,line) */
parabola p=parabola(A,B,C,l);
draw(p,blue);
draw(p.D,blue);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0560

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

Figure 0056
(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 – fig0570

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

Figure 0057
(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,-2);
dot("$A$",A,S,red);

circle C=circle(A,2);
draw(C);
/* View the definition of void distance(picture pic,Label,point,point,bool,real,pen,pen,arrow) */
distance("$R=2$",A,point(C,0),0);

/* View the definition of point relpoint(explicit circle,real) */
dot("relpoint(C, 0)",relpoint(C,0),E);

/* View the definition of point point(circle,abscissa) */
dot("relpoint(C, 0.25)",point(C,Relative(0.25)),NW);
// point(C,Relative(0.25)) can be replaced by relpoint(C,0.25) OR point(C,relabscissa(0.25))

dot("relpoint(C, 0.5)",relpoint(C,0.5),W);
dot("relpoint(C, 0.75)",relpoint(C,0.75),SE);
dot("relpoint(C, 1.125)",relpoint(C,1.125),NE);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0580

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

Figure 0058
(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,-1.5);
dot("$A$",A,S,red);

ellipse el=ellipse(A,3,1,20);
draw(el);

/* View the definition of point relpoint(explicit ellipse,real) */
dot("relpoint(el, 0)",relpoint(el,0),E);

/* View the definition of point point(ellipse,abscissa) */
dot("relpoint(el, 0.25)",point(el,Relative(0.25)),NW);
// point(el,Relative(0.25)) can be replaced by relpoint(el,0.25) OR point(el,relabscissa(0.25))

dot("relpoint(el, 0.5)",relpoint(el,0.5),W);
dot("relpoint(el, 0.75)",relpoint(el,0.75),SE);
dot("relpoint(el, 1.125)",relpoint(el,1.125),NW);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0590

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

Figure 0059
(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=(2,-1.5);
dot("$F$",F,N,red);

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

parabola p=parabola(F,0.2,90);

// Define the bounding box to draw the parabola.
// Try finalbounds(); to determine the final bounding box.
p.bmin=(-0.5,-0.4);
p.bmax=(3.7,0.75);

draw(p,dashed); /* Defered drawing to adjust the path to the final
                   bounding box.*/

draw((path)p); /* The path of 'p' is restricted to the box whose
                  the corners are p.bmin, p.bmax.*/

/* View the definition of point relpoint(explicit parabola,real) */
dot("relpoint(p, 0)",relpoint(p,0),SE);

/* View the definition of point point(parabola,abscissa) */
dot("relpoint(p, 0.25)",point(p,Relative(0.25)),NE);
// point(p,Relative(0.25)) can be replaced by relpoint(p,0.25) OR point(p,relabscissa(0.25))

dot("relpoint(p, -0.5)",relpoint(p,-0.5),W);
dot("relpoint(p, -1)",relpoint(p,-1),W);
dot("relpoint(p, 1)",relpoint(p,1),E);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0600

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

Figure 0060
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(11cm,0);

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

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

circle C=circle(A,2);
draw(C);
distance("$R=2$",A,point(C,0),0);

/* View the definition of pair curpoint(explicit circle,real) */
dot("curpoint(C, pi/2)", curpoint(C,pi/2),NE);

dot("curpoint(C, -pi/2)", curpoint(C,-pi/2));

/* View the definition of abscissa curabscissa(real) */
dot("curpoint(C, pi)", point(C,curabscissa(pi)),NW);
// point(C,curabscissa(pi)) can be replaced by curpoint(C,pi)

dot("curpoint(C, 2*pi)", curpoint(C,2*pi),W);
dot("curpoint(C, 3*pi)", curpoint(C,3*pi),SE);
dot("curpoint(C, 4.25*pi)", curpoint(C,4.25*pi),E);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0610

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

Figure 0061
(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=(4,2);

ellipse el=ellipse(A,3,2,30);
draw(el);
dot("$C$",el.C,S,red);


/* View the definition of pair curpoint(explicit ellipse,real) */
dot("curpoint(el, 0)", curpoint(el,0), E);

real L=arclength(el);


dot("curpoint(el, L/8)", curpoint(el,L/8),NW);

dot("curpoint(el, -L/8)", curpoint(el,-L/8));

/* View the definition of abscissa curabscissa(real) */
dot("point(el,curabscissa(L/4))", point(el,curabscissa(L/4)),NW);
// point(el,curabscissa(pi)) can be replaced by curpoint(el,pi)

dot("curpoint(el, L/2)", curpoint(el,L/2),W);
dot("curpoint(el, 3*L/4)", curpoint(el,3*L/4),SE);
dot("curpoint(el, 9*L/8)", curpoint(el,9*L/8),4N+4W);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0620

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

Figure 0062
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(10cm);

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

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

draw(p);

/* View the definition of point curpoint(explicit parabola,real) */
dot("curpoint(p, 0)",curpoint(p,0),SE);

/* View the definition of point point(parabola,abscissa) */
dot("curpoint(p, 0.5)",point(p,curabscissa(0.5)),NE);
// point(p,curabscissa(0.5)) can be replaced by curpoint(p,0.5)

dot("curpoint(p, -0.5)",curpoint(p,-0.5),W);
dot("curpoint(p, -2)",curpoint(p,-2),W);
dot("curpoint(p, 2)",curpoint(p,2),E);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0630

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

Figure 0063
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(11cm,0);

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

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

circle C=circle(A,2);
draw(C);
distance("$R=2$",A,point(C,0),0);

/* View the definition of point angpoint(explicit circle,real) */
dot("angpoint(C, 90)", angpoint(C,90),NW);

/* View the definition of abscissa angabscissa(real,polarconicroutine) */
dot("angpoint(C, 180)", point(C,angabscissa(180)), W);
// point(C,angabscissa(180)) can be replaced by angpoint(C,180)

dot("angpoint(C, 270)", angpoint(C,270),SE);
dot("angpoint(C, 405)", angpoint(C,405),NE);
dot("angpoint(C, -45)", angpoint(C,-45),SE);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0640

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

Figure 0064
(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=(4,2);

ellipse el=ellipse(A,3,2,20);
draw(el);
dot("$C$",el.C,2W,red);

dot("$F_1$",el.F1,S);
dot("$F_2$",el.F2,S);


/* View the definition of point angpoint(explicit ellipse,real,polarconicroutine) */
point P=angpoint(el, 0);
dot("angpoint(el, 0)", P,E);
draw(el.F1--P);

point P=angpoint(el, 90);
dot("angpoint(el, 90)", P,NW);
draw(el.F1--P);

point P=angpoint(el, 90, fromCenter);
dot("angpoint(el,90,fromCenter)", P,NW);
draw(el.C--P);


/* View the definition of abscissa angabscissa(real,polarconicroutine) */
dot("angpoint(el, 180)", point(el,angabscissa(180)), W);
// point(el,angabscissa(180)) can be replaced by angpoint(el,180)

dot("angpoint(el, 270)", angpoint(el,270),SE);
dot("angpoint(el, 370)", angpoint(el,370),NE);
dot("angpoint(el, -45)", angpoint(el,-45),SE);

point P=angpoint(el, -45, fromCenter);
dot("angpoint(el,-45,fromCenter)", P,S);
draw(el.C--P);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0650

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

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

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

point A=(4,2);

ellipse el=ellipse(A,3,2,20);
draw(el);
dot("$C$",el.C,S,red);

dot("$F_1$",el.F1,S);
dot("$F_2$",el.F2,S);


///////////////////////////////////////
currentpolarconicroutine=fromCenter;//
/////////////////////////////////////

/* View the definition of point angpoint(explicit ellipse,real,polarconicroutine) */
point P=angpoint(el, 0);
dot("angpoint(el, 0)", P,E);
draw(el.C--P);

point P=angpoint(el, 90);
dot("angpoint(el, 90)", P,NW);
draw(el.C--P);

point P=angpoint(el, 90, fromFocus);
dot("angpoint(el,90,fromFocus)", P,NW);
draw(el.F1--P);


/* View the definition of abscissa angabscissa(real,polarconicroutine) */
dot("angpoint(el, 180)", point(el,angabscissa(180)), W);

dot("angpoint(el, 370)", angpoint(el,370),NE);
dot("angpoint(el, -45)", angpoint(el,-45),SE);

point P=angpoint(el, -45, fromFocus);
dot("angpoint(el,-45,fromFocus)", P,S);
draw(el.F1--P);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0660

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

Figure 0066
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(10cm);

point F=(1,0.5);
dot("$F$",F,E,red);

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

draw(p);

coordsys R=currentcoordsys;
show(R);

coordsys Rp=canonicalcartesiansystem(p);
show(Label("$O'$",align=NW+W,blue), Label("$\vec{u}$",blue), Label("$\vec{v}$",blue), Rp, ipen=blue);

/* View the definition of point angpoint(explicit parabola,real) */
dot("angpoint(p, 180)",angpoint(p,180),SE+E);

/* View the definition of point point(parabola,abscissa) */
point P=point(p,angabscissa(55));
// point(p,angbscissa(0.5)) can be replaced by angpoint(p,0.5)
dot("angpoint(p, 55)",P,NE);

segment s=segment(F,P);
draw(s);
line l=line(F,F+Rp.i);
markangle("$"+(string)degrees(l,s)+"^\circ$",l,(line)s,Arrow);

dot("angpoint(p, -45)",angpoint(p,-45),W);
dot("angpoint(p, -55)",angpoint(p,-55),W);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0670

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

Figure 0067
(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));

coordsys R=currentcoordsys;
show(R);

coordsys Rp=canonicalcartesiansystem(h);
show(Label("$O'$",align=SW,blue), Label("$\vec{u}$",blue), Label("$\vec{v}$",blue), Rp, ipen=blue);

/* View the definition of point angpoint(explicit hyperbola,real,polarconicroutine) */
dot(rotate(70)*"angpoint(h, 180)",angpoint(h,180),E);

/* View the definition of point point(hyperbola,abscissa) */
point P=point(h,angabscissa(55));
// point(h,angbscissa(0.5)) can be replaced by angpoint(h,0.5)
dot("angpoint(h, 55)",P,SE);

/* View the definition of path arcfromfocus(conic,real,real,int,bool) */
draw(arcfromfocus(h,55,180), bp+red);

segment s=segment(h.F1,P);
draw(s);
dot("$F_1$",h.F1,N+NW);
line l=line(h.F1,h.F1-Rp.i);
markangle("$55^\circ$",l,(line)s,Arrow);

dot("angpoint(p, -50)",angpoint(h,-50),W);
dot("angpoint(p, -55)",angpoint(h,-55),NE);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0680

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

Figure 0068
(Compiled with Asymptote version 1.92svn-r4817)
    
import geometry;
size(12cm);

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

point C=(4,2);
dot("$C$", C, NW, red);

hyperbola h=hyperbola(C, 2, 1.5, -10);
draw(h);

///////////////////////////////////////
currentpolarconicroutine=fromCenter;//
/////////////////////////////////////

coordsys Rp=canonicalcartesiansystem(h);
show(Label("$O'$", align=SW,blue),
     Label("$\vec{u}$",blue),
     Label("$\vec{v}$",blue),
     Rp, ipen=blue);

/* View the definition of point angpoint(explicit hyperbola,real,polarconicroutine) */
dot("angpoint(h, 0)", angpoint(h,0), E+NE);
dot(rotate(80)*"angpoint(h, 180)", angpoint(h,180),E);

draw(arcfromcenter(h,0,30), bp+red);

// point(p,angbscissa(150)) can be replaced by angpoint(p,150)
dot("angpoint(h, 150)", point(h, angabscissa(150)), E);

point P=point(h, angabscissa(210));
dot("angpoint(h, 210)", P, E);

point P=angpoint(h, 30);
dot("angpoint(h, 30)", P, E);

segment s=segment(C, P);
draw(s);
markangle("$30^\circ$", Ox(Rp),(line) s, radius=1.5cm, Arrow);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0690

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

Figure 0069
(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=(4,2);
dot("$A$",A,S,red);

real R=2;
circle C=circle(A,R);
draw(C,linewidth(1mm));
draw("$R="+(string)R+"$", A--point(C,0), N, Arrows);

/* View the definition of point point(explicit circle,explicit real) */
dot("point(C, 15)", point(C,15),2E,3mm+blue);

/* View the definition of abscissa nodabscissa(real) */
dot("point(C, 40)",
    point(C,nodabscissa(40)),
    2W,3mm+blue);
// point(C,nodabscissa(40)) can be replaced by point(C,40)

/* View the definition of int circlenodesnumber(real) */
dot("point(C, 3*circlenodesnumber(R)/4)",
    point(C, 3*circlenodesnumber(R)/4), S, 3mm+blue);

dot((path)C, yellow);

write(length((path)C));

Étiquettes : , , ,


Asymptote using geometry.asy – fig0700

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

Figure 0070
(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=(4,2);

real a=2, b=3;
ellipse el=ellipse(A,a,b);

dot("$C$",el.C,N,red);
draw(el,linewidth(1mm));

/* View the definition of point point(explicit ellipse,explicit real) */
dot("point(el, 0)", point(el,0),N,3mm+blue);

dot("point(el, 15)", point(el,15),2W,3mm+blue);

/* View the definition of abscissa nodabscissa(real) */
dot("point(el, 40)",
    point(el,nodabscissa(40)),
    2W,3mm+blue);
// point(el,nodabscissa(40)) can be replaced by point(el,40)

/* View the definition of int circlenodesnumber(real) */
dot("point(el, 3*circlenodesnumber(max(a,b))/4)",
    point(el, 3*circlenodesnumber(max(a,b))/4), S, 3mm+blue);

dot((path)el, yellow);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0710

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

Figure 0071
(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 F=(2,-1.5);
dot("$F$",F,N,red);

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

parabola p=parabola(F,0.2,90);

draw(p,bp+dashed); /* Defered drawing to adjust the path to the final
                   bounding box.*/

// Define the bounding box to draw the parabola.
// Try finalbounds(); to determine the final bounding box.
p.bmin=(-0.5,-0.4);
p.bmax=(3.7,0.75);
draw((path)p, linewidth(bp)); /* The path of 'p' is restricted to the box whose
                  the corners are p.bmin, p.bmax.*/

/* View the definition of point point(explicit parabola,explicit real) */
dot("point(p, 0)", point(p,0),2E,3mm+blue);

dot("point(p, 15)", point(p,15),2W,3mm+blue);

/* View the definition of abscissa nodabscissa(real) */
dot("point(p, 40)", point(p,nodabscissa(40)), 2W,3mm+blue);
// point(p,nodabscissa(40)) can be replaced by point(p,40)

/* View the definition of real[] bangles(picture,parabola) */
real[] bg=bangles(p);

/* View the definition of int parabolanodesnumber(parabola,real,real) */
dot("point(p, parabolanodesnumber(p,bg[0],bg[1])/2)",
    point(p, parabolanodesnumber(p,bg[0],bg[1])/2), S, 3mm+blue);

dot((path)p, yellow);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0720

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

Figure 0072
(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 C=(3,2);
dot("$C$", C, N, red);

// Enlarge the bounding box of the current picture.
draw(box((0,0),(5,4.5)), invisible);

hyperbola h=hyperbola(C, 1, 2);

draw(h, bp+dashed); /* Defered drawing to adjust the path to the final
                       bounding box.*/

// Define the bounding box to draw the hyperbola.
// Try finalbounds(); to determine the final bounding box.
h.bmin=(0,0.5); h.bmax=(5,4);
draw((path)h, linewidth(bp)); /* The path of 'p' is restricted to the box whose
                                 the corners are p.bmin, p.bmax.*/

/* View the definition of point point(explicit hyperbola,explicit real) */
dot("point(h, 0)", point(h,0), 2W, 3mm+blue);

dot("point(h, 15)", point(h,15), 2W, 3mm+blue);

/* View the definition of abscissa nodabscissa(real) */
dot("point(h, 40)", point(h,nodabscissa(40)), 2W,3mm+blue);
// point(h,nodabscissa(40)) can be replaced by point(h,40)

/* View the definition of real[] bangles(picture,hyperbola) */
real[][] bg=bangles(h);

dot((path)h, yellow);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0730

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

Figure 0073
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
unitsize(2cm);

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

point A=(-2,2);
dot("$A$",A,S);
point B=A+(cos(0.5),cos(1));
dot("$B$",B,S);


circle c=circle(A,2);
draw(c);

line l=line(A,B);
draw(l);
point M=intersectionpoints(l,c)[0];
point P=intersectionpoints(l,c)[1];

/* View the definition of void dot(picture,Label,explicit point,align,string,pen) */
dot("",M,2E,linewidth(2mm));
dot("$M$",M,2W);
dot("",P,2E,linewidth(2mm));
dot("$P$",P,2W);

pair p=A-(4,2.5);
transform t=shift((0,-0.3));
transform T=shift((4,0));
real x;

/* View the definition of abscissa angabscissa(circle,point) */
x=angabscissa(c,M).x;
label("angabscissa(c,M).x=$"+(string)x+"^\circ$",p,E);
dot(angpoint(c,x),1mm+red);
x=angabscissa(c,P).x;
label("angabscissa(c,P).x=$"+(string)x+"^\circ$",T*p,E);
dot(angpoint(c,x),1mm+red);

p=t*p;
/* View the definition of abscissa curabscissa(circle,point) */
x=curabscissa(c,M).x;
dot(curpoint(c,x),1mm+red);
label("curabscissa(c,M).x="+(string)x,p,E);
x=curabscissa(c,P).x;
label("curabscissa(c,P).x="+(string)x,T*p,E);
dot(curpoint(c,x),1mm+red);

p=t*p;
/* View the definition of abscissa nodabscissa(circle,point) */
x=nodabscissa(c,M).x;
label("nodabscissa(c,M).x="+(string)x,p,E);
dot(point(c,x),1mm+red);
x=nodabscissa(c,P).x;
label("nodabscissa(c,P).x="+(string)x,T*p,E);
dot(point(c,x),1mm+red);

p=t*p;
/* View the definition of abscissa relabscissa(circle,point) */
x=relabscissa(c,M).x;
label("relabscissa(c,M).x="+(string)x,p,E);
dot(relpoint(c,x),1mm+red);
x=relabscissa(c,P).x;
label("relabscissa(c,P).x="+(string)x,T*p,E);
dot(relpoint(c,x),1mm+red);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0740

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

Figure 0074
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
unitsize(2cm);

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

point A=(-2,2);
dot("$A$",A,S);
point B=A+(cos(0.5),cos(1));
dot("$B$",B,S);


ellipse el=ellipse(A,3,2,0);
draw(el);
line l=line(A,B);
draw(l);
point M=intersectionpoints(l,el)[0];
point P=intersectionpoints(l,el)[1];

/* View the definition of void dot(picture,Label,explicit point,align,string,pen) */
dot("",M,2E,linewidth(2mm));
dot("$M$",M,2W);
dot("",P,2E);
dot("$P$",P,2W,linewidth(2mm));

pair p=A-(4,2.5);
transform t=shift((0,-0.3));
transform T=shift((4,0));
real x;

/* View the definition of abscissa angabscissa(ellipse,point,polarconicroutine) */
x=angabscissa(el,M).x;
label("angabscissa(el,M).x=$"+(string)x+"^\circ$",p,E);
dot(angpoint(el,x),1mm+red);
x=angabscissa(el,P).x;
label("angabscissa(el,P).x=$"+(string)x+"^\circ$",T*p,E);
dot(angpoint(el,x),1mm+red);

p=t*p;
/* View the definition of abscissa curabscissa(ellipse,point) */
x=curabscissa(el,M).x;
dot(curpoint(el,x),1mm+red);
label("curabscissa(el,M).x="+(string)x,p,E);
x=curabscissa(el,P).x;
label("curabscissa(el,P).x="+(string)x,T*p,E);
dot(curpoint(el,x),1mm+red);

p=t*p;
/* View the definition of abscissa nodabscissa(ellipse,point) */
x=nodabscissa(el,M).x;
label("nodabscissa(el,M).x="+(string)x,p,E);
dot(point(el,x),1mm+red);
x=nodabscissa(el,P).x;
label("nodabscissa(el,P).x="+(string)x,T*p,E);
dot(point(el,x),1mm+red);

p=t*p;
/* View the definition of abscissa relabscissa(ellipse,point) */
x=relabscissa(el,M).x;
label("relabscissa(el,M).x="+(string)x,p,E);
dot(relpoint(el,x),1mm+red);
x=relabscissa(el,P).x;
label("relabscissa(el,P).x="+(string)x,T*p,E);
dot(relpoint(el,x),1mm+red);

Étiquettes : , , ,


Asymptote using geometry.asy – fig0750

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

Figure 0075
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
unitsize(2cm);

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

point A=(-2.5,2);
dot("$A$",A,S);
point B=A+(cos(0.5),cos(1));
dot("$B$",B,S);

point F=(-1,0.5);
dot("$F$",F,NW);

parabola pb=parabola(F,0.2,130);
draw(pb);
line l=line(A,B);
draw(l);
point M=intersectionpoints(l,pb)[0];
point P=intersectionpoints(l,pb)[1];

/* View the definition of void dot(picture,Label,explicit point,align,string,pen) */
dot("",M,2E,linewidth(2mm));
dot("$M$",M,2W);
dot("",P,2E,linewidth(2mm));
dot("$P$",P,2W);

pair p=A-(4,2.5);
transform t=shift((0,-0.3));
transform T=shift((4,0));
real x;

/* View the definition of abscissa angabscissa(parabola,point) */
x=angabscissa(pb,M).x;
label("angabscissa(pb,M).x=$"+(string)x+"^\circ$",p,E);
dot(angpoint(pb,x),1mm+red);
x=angabscissa(pb,P).x;
label("angabscissa(pb,P).x=$"+(string)x+"^\circ$",T*p,E);
dot(angpoint(pb,x),1mm+red);

// p=t*p;
// /* View the definition of abscissa curabscissa(parabola,point) */
// x=curabscissa(pb,M).x;
// dot(curpoint(pb,x),1mm+red);
// label("curabscissa(pb,M).x="+(string)x,p,E);
// x=curabscissa(pb,P).x;
// label("curabscissa(pb,P).x="+(string)x,T*p,E);
// dot(curpoint(pb,x),1mm+red);

// p=t*p;
// /* View the definition of abscissa nodabscissa(parabola,point) */
// x=nodabscissa(pb,M).x;
// label("nodabscissa(pb,M).x="+(string)x,p,E);
// dot(point(pb,x),1mm+red);
// x=nodabscissa(pb,P).x;
// label("nodabscissa(pb,P).x="+(string)x,T*p,E);
// dot(point(pb,x),1mm+red);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0760

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

Figure 0076
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(12cm);

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

conic co[];
co[0]=circle((point)(0,0),1);
/* View the definition of void draw(picture,Label,explicit conic,align,pen,arrowbar,arrowbar,margin,Label,marker) */
draw(co[0]);

co[1]=ellipse((point)(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)
    /* View the definition of point[] intersectionpoints(conic,conic) */
    dot(intersectionpoints(co[i],co[j]), red);
}

Étiquettes : , , , , , , ,


Asymptote using geometry.asy – fig0770

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

Figure 0077
(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,1)  ; dot("$C$",C,SW);
point D=(1,-1) ; dot("$D$",D,SW);

circle c=circle(origin(),2);

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(ellipse,point,point,bool) */
draw(arc(c,J[0],K[0]),1mm+0.8yellow);
draw(arc(c,K[0],J[1]),1mm+0.8red);
/* View the definition of arc arc(ellipse,abscissa,abscissa,bool) */
draw(arc(c,angabscissa(c,J[1]),angabscissa(c,K[1])),1mm+0.8blue);
draw(arc(c,angabscissa(c,K[1]),angabscissa(c,J[0])),1mm+0.8green);

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

Étiquettes : , , ,


Asymptote using geometry.asy – fig0780

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

Figure 0078
(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,1)  ; dot("$C$",C,SW);
point D=(1,-1) ; dot("$D$",D,SW);

ellipse el=ellipse((point)(0,0.5),2,1);

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

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

/* View the definition of arc arc(ellipse,point,point,bool) */
draw(arc(el, J[0],K[0]), 1mm+0.8yellow);
draw(arc(el, K[0],J[1]), 1mm+0.8red);
/* View the definition of arc arc(ellipse,abscissa,abscissa,bool) */
draw(arc(el,angabscissa(el,J[1]), angabscissa(el,K[1])), 1mm+0.8blue);
draw(arc(el,angabscissa(el,K[1]), angabscissa(el,J[0])), 1mm+0.8green);

dot("$J_0$", J[0], 2N); dot("$J_1$", J[1], 2S);
dot("$K_0$", K[0], 2NE) ; dot("$K_1$", K[1], 2dir(-35));

Étiquettes : , , ,


Asymptote using geometry.asy – fig0790

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

Figure 0079
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(6cm);

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

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

circle cle=circle(A,C,B);
draw(cle,linewidth(2mm));

draw(arc(cle,A,B), dotsize()+red);
draw(arc(cle,A,B,CW), dotsize()+blue);

dot(Label("$A$", black), A, 1.5NW, white);
dot(Label("$B$", black), B, E, white);
dot(Label("$C$", black), C, NW, white);

Étiquettes : , ,


Asymptote using geometry.asy – fig0800

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

Figure 0080
(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=(1,1);
dot("$A$",A,S,0.8red);

real R=2;
/* View the definition of struct arc */
arc C=arc(circle(A,R),45,180);/* View the definition of arc arc(ellipse,real,real,polarconicroutine,bool) */
draw(C,Arrow);

/* View the definition of arc complementary(arc) */
draw(complementary(C),dashed+grey,Arrow(position=Relative(0.75)));

/* View the definition of arc *(transform,explicit arc) */
arc Cp=scale(0.5,A)*C;
draw(Cp,0.8red,Arrow);

arc Cp=scale(-0.5,A)*C;
draw(Cp,0.8blue,Arrow);

arc Cp=scale(1.1,A)*C;
/* View the definition of arc reverse(arc) */
draw(reverse(Cp),0.8*yellow,Arrow);

arc Cp=scale(0.9,A)*C;
draw(rotate(225,A)*Cp,0.8green,Arrow);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0810

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

Figure 0081
(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=(1,1);
dot("$A$",A,S,0.8red);

real R=2;
/* View the definition of struct arc */
arc C=arc(ellipse(A,2R,R),45,180,fromCenter);
draw(C,Arrow);

/* View the definition of arc complementary(arc) */
draw(complementary(C),dashed+grey,Arrow(position=Relative(0.75)));

/* View the definition of arc *(transform,explicit arc) */
arc Cp=scale(0.5,A)*C;
draw(Cp,0.8red,Arrow);

arc Cp=scale(-0.5,A)*C;
draw(Cp,0.8blue,Arrow);

arc Cp=scale(1.1,A)*C;
/* View the definition of arc reverse(arc) */
draw(reverse(Cp),0.8*yellow,Arrow);

arc Cp=scale(0.9,A)*C;
draw(rotate(225,A)*Cp,0.8green,Arrow);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0820

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

Figure 0082
(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=(1,1);
dot("$A$",A,S,red);

real R=2;
arc C=arc(circle(A,R), 45, 210);
draw(C,linewidth(4mm));

/* View the definition of void markarc(picture,Label,int,real,real,arc,arrowbar,pen,pen,margin,marker) */
markarc(format("%0g",degrees(C)), C, Arrow);

/* View the definition of arc *(real, explicit arc) */
draw(0.5*C,2mm+yellow);

arc Cp=C/3;
draw(Cp,1mm+blue);
markarc(format("%0g",degrees(Cp)), radius=25mm, Cp, blue, Arrow);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0830

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

Figure 0083
(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=(1,1);
dot("$A$", A, NW, red);

real R=2;
arc C=arc(circle(A,R), 45, 210, CW);
draw(C,linewidth(4mm));

/* View the definition of void markarc(picture,Label,int,real,real,arc,arrowbar,pen,pen,margin,marker) */
markarc(format("%0g",degrees(C)), C, radius=markangleradius(), Arrow);

/* View the definition of arc *(real, explicit arc) */
draw(0.5*C, 2mm+yellow);

arc Cp=C/3;
draw(Cp, 1mm+blue);
markarc(format("%0g",degrees(Cp)), radius=-25mm, Cp, blue, Arrow);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0840

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

Figure 0084
(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 C=(1,1);
dot("$C$", C, NE, red);

real R=2;
arc a=arc(ellipse(C,R,R/2), 90, 0, fromCenter);
draw(a, linewidth(4mm));

/* View the definition of void markarc(picture,Label,int,real,real,arc,arrowbar,pen,pen,margin,marker) */
markarc(format("%0g", degrees(a)), radius=-0.5*markangleradius(), a);

/* View the definition of arc *(real, explicit arc) */
draw(0.5*a, 2mm+yellow);

arc ap=a/3;
draw(ap, 1mm+blue);
markarc(format("%0g", degrees(ap)), radius=1.5*markangleradius(), ap, blue);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0850

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

Figure 0085
(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 C=(1,1);
dot("$C$", C, dir(30), red);

arc a=arc(ellipse(C,2,1,30), -45, 45);
draw(a, linewidth(4mm));
dot("$F_1$", a.el.F1, dir(210), red);

/* View the definition of void markarc(picture,Label,int,real,real,arc,arrowbar,pen,pen,margin,marker) */
markarc(format("%0g", degrees(a)), radius=2.5*markangleradius(), a);

/* View the definition of arc *(real, explicit arc) */
draw(0.5*a, 2mm+yellow);

arc ap=a/3;
draw(ap, 1mm+blue);
markarc(format("%0g", degrees(ap)), radius=1.5*markangleradius(), ap, blue);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0860

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

Figure 0086
(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);

point A=(1,1);
dot("$A$", A, S, red);

arc C=arc(circle(A,2), 45, 270);
draw(C, Arrow);

/* View the definition of real degrees(arc) */
write(degrees(C)); // Output is 225

draw(complementary(C), grey+dashed);
distance("$R=2$",A,point(C,0),0);

/* View the definition of point relpoint(arc,real) */
dot("relpoint(C, 0)", relpoint(C,0),E);

/* View the definition of point point(arc,abscissa) */
dot("relpoint(C, 0.25)", point(C,Relative(0.25)),N);// point(C,Relative(0.25)) is similar to relpoint(C,0.25)
dot("relpoint(C, -0.5)", relpoint(C,-0.5),E);
dot("relpoint(C, 0.5)",  relpoint(C,0.5),W);
dot("relpoint(C, 0.75)", relpoint(C,0.75),W);
dot("relpoint(C, 1.25)", relpoint(C,1.25),E);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0870

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

Figure 0087
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(12cm,0);

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

point A=(1,1);
dot("$A$", A, S, red);

arc C=arc(ellipse(A,2,1,45), 45, 270, fromCenter);
// arc C=arc(ellipse(A,2,1), 45, -45);

draw(C, Arrow);
draw(complementary(C), grey+dashed);
distance("$R=2$",A,point(C.el,0),0);

/* View the definition of point relpoint(arc,real) */
dot("relpoint(C, 0)", relpoint(C,0),W);

/* View the definition of point point(arc,abscissa) */
dot("relpoint(C, 0.25)", point(C,Relative(0.25)),W);// point(C,Relative(0.25)) is similar to relpoint(C,0.25)
dot("relpoint(C, -0.5)", relpoint(C,-0.5),E);
dot("relpoint(C, 0.5)",  relpoint(C,0.5),W);
dot("relpoint(C, 0.75)", relpoint(C,0.75),SE);
dot("relpoint(C, 1.25)", relpoint(C,1.25),E);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0880

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

Figure 0088
(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);

point A=(3.5,0.5);
dot("$A$",A,S,red);

arc C=arc(circle(A,2),45,270,CCW);
draw(C,Arrow);
draw(complementary(C),grey+dashed);
/* View the definition of void distance(picture pic,Label,point,point,bool,real,pen,pen,arrow) */
distance("$R=2$",A,point(C.el,0),0);

/* View the definition of point curpoint(arc,real) */
dot("curpoint(C, 0)", curpoint(C,0),E);
dot("curpoint(C, pi/2)", curpoint(C,pi/2),N);
dot("curpoint(C, -pi/2)", curpoint(C,-pi/2));

// dot("curpoint(C, pi)", point(C,curabscissa(pi)),W); // OR curpoint(C,pi)
dot("curpoint(C, pi)", curpoint(C,pi),W);

dot("curpoint(C, 2*pi)", curpoint(C,2*pi),SW);
dot("curpoint(C, 3*pi)", curpoint(C,3*pi),E);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0890

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

Figure 0089
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(12cm,0);

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

point A=(3.5,0.5);
dot("$A$",A,SW,red);

arc C=arc(ellipse(A,2,1,-30),90,270,fromCenter,CCW);
real l=arclength(C);

draw(C,Arrow);
draw(complementary(C),grey+dashed);
distance("$R=2$",A,point(C.el,0),0);

/* View the definition of point curpoint(arc,real) */
dot("curpoint(C, 0)", curpoint(C,0),E);
dot("curpoint(C, l/4)", curpoint(C,l/4),0.5N+E);
dot("curpoint(C, -l/4)", curpoint(C,-l/4));

dot("curpoint(C, l/2)", point(C,curabscissa(l/2)),W); // point(C,curabscissa(l/2)) is similar to curpoint(C,pi)
dot("curpoint(C, l)", curpoint(C,l), SW);
dot("curpoint(C, 3*l/2)", curpoint(C,3*l/2),E);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0900

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

Figure 0090
(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);

point A=(3.5,0.5);
dot("$A$", A, S, red);

arc C=arc(circle(A,2), 60, 270, CCW);
draw(C,Arrow);
draw(complementary(C), grey+dashed);
distance("$R=2$",A,point(C.el,0),0);

/* View the definition of point angpoint(arc,real) */
dot("angpoint(C, 90)",  angpoint(C,90), W);

dot("angpoint(C, 180)", point(C,angabscissa(180)), SW); // point(C,angabscissa(180)) is similar to angpoint(C,180)

dot("angpoint(C, 270)", angpoint(C,270), E);
dot("angpoint(C, -45)", angpoint(C,-45), E);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0910

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

Figure 0091
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(12cm,0);

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

point A=(3.5,0.5);
dot("$A$", A, S, red);

/* View the definition of arc reverse(arc) */
arc C=reverse(arc(ellipse(A,2,1,20), 45, 270, fromCenter));
draw(C,Arrow);
draw(complementary(C), grey+dashed);
distance("$R=2$",A,point(C.el,0),0);

/* View the definition of point angpoint(arc,real) */
dot("angpoint(C, 90)",  angpoint(C,90), SW);

dot("angpoint(C, 180)", point(C,angabscissa(180)), NW); // point(C,angabscissa(180)) is similar to angpoint(C,180)

dot("angpoint(C, 270)", angpoint(C,270), E);
dot("angpoint(C, -45)", angpoint(C,-45), E);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0920

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

Figure 0092
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
unitsize(1.5cm);

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

real R=2;
point A=(3.5,1.5);

dot("$A$",A,S,red);

arc C=arc(circle(A,2), 45, 270);
draw(C,Arrow);
draw(complementary(C),grey+dashed);
distance("$R=2$",A,point(C,0),0);

/* View the definition of point point(arc,real) */
dot("point(C, 15)", point(C,15), 2N, 3mm+blue);

dot("point(C, 30)",
    point(C,nodabscissa(30)), // OR point(C,40)
    2W,3mm+blue);

/* View the definition of int arcnodesnumber(explicit arc) */
dot(Label("point(C, 3*arcnodesnumber(R)/4)",UnFill),
    point(C, 3*arcnodesnumber(C)/4), 2E, 3mm+blue);

dot((path)C, yellow);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0930

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

Figure 0093
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
unitsize(1.5cm);

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

real R=2;
point A=(3.5,1.5);

dot("$A$",A,S,red);

arc C=arc(ellipse(A,2,1,45), 45, 270, fromCenter);
draw(C,Arrow);
draw(complementary(C),grey+dashed);
distance("$R=2$",A,point(C.el,0),0);

/* View the definition of point point(arc,real) */
dot("point(C, 15)", point(C,15), W, 3mm+blue);

dot("point(C, 30)",
    point(C,nodabscissa(30)), // OR point(C,40)
    S,3mm+blue);

/* View the definition of int arcnodesnumber(explicit arc) */
dot(Label("point(C, 3*arcnodesnumber(R)/4)",UnFill),
    point(C, 3*arcnodesnumber(C)/4), 2E, 3mm+blue);

dot((path)C, yellow);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0940

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

Figure 0094
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
unitsize(2cm);
linemargin=0.5cm;

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

point A=(3.5,0.75);
dot("$A$",A,S);
point B=A+(cos(0.5),cos(1));
dot("$B$",B,S);


arc c=arc(circle(A,2), 45, 270, CCW);
arc cc=complementary(c);
draw(c,Arrow);
draw(cc,dashed+grey);

line l=line(A,B);
draw(l);
point M=intersectionpoints(l,c)[0];
point P=intersectionpoints(l,cc)[0];

dot("", M, 2E);
dot("$M$", M, 2W, linewidth(2mm));
dot("", P, 2E);
dot("$P$", P, 2W, linewidth(2mm));
dot("$O$", point(c,0), SE);

point p=A-(4,2.5);
transform t=shift((0,-0.3));
transform T=shift((4,0));
real x;

/* View the definition of abscissa angabscissa(arc,point) */
x=angabscissa(c,M).x;
label("angabscissa(c,M).x=$"+(string)x+"^\circ$",p,E);
dot(angpoint(c,x),1mm+red);
x=angabscissa(c,P).x;
label("angabscissa(c,P).x=$"+(string)x+"^\circ$",T*p,E);
dot(angpoint(c,x),1mm+red);

p=t*p;
/* View the definition of abscissa curabscissa(arc,point) */
x=curabscissa(c,M).x;
dot(curpoint(c,x),1mm+red);
label("curabscissa(c,M).x="+(string)x,p,E);
x=curabscissa(c,P).x;
label("curabscissa(c,P).x="+(string)x,T*p,E);
dot(curpoint(c,x),1mm+red);

p=t*p;
/* View the definition of abscissa nodabscissa(arc,point) */
x=nodabscissa(c,M).x;
label("nodabscissa(c,M).x="+(string)x,p,E);
dot(point(c,x),1mm+red);
label("nodabscissa(c,P).x= \scriptsize{ERROR (point is not on the arc!)}",T*p,E);

p=t*p;
/* View the definition of abscissa relabscissa(arc,point) */
x=relabscissa(c,M).x;
label("relabscissa(c,M).x="+(string)x,p,E);
dot(relpoint(c,x),1mm+red);
x=relabscissa(c,P).x;
label("relabscissa(c,P).x="+(string)x,T*p,E);
dot(relpoint(c,x),1mm+red);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0950

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

Figure 0095
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
unitsize(2cm);
linemargin=0.5cm;

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

point A=(3.5,0.75);
dot("$A$",A,S);
point B=A+(cos(0.5),cos(1));
dot("$B$",B,S);


arc c=rotate(45,B)*xscale(2,A)*arc(circle(A,2), 45, 270, CCW);
arc cc=complementary(c);
draw(c,Arrow);
draw(cc,dashed+grey);

line l=line(A,B);
draw(l);
point M=intersectionpoints(l,c)[0];
point P=intersectionpoints(l,cc)[0];

dot("", M, 2E);
dot("$M$", M, 2W, linewidth(2mm));
dot("", P, 2E);
dot("$P$", P, 2W, linewidth(2mm));
dot("$O$", point(c,0), SE);

point p=A-(4,2.5);
transform t=shift((0,-0.3));
transform T=shift((4,0));
real x;

/* View the definition of abscissa angabscissa(arc,point) */
x=angabscissa(c,M).x;
label("angabscissa(c,M).x=$"+(string)x+"^\circ$",p,E);
dot(angpoint(c,x),1mm+red);
x=angabscissa(c,P).x;
label("angabscissa(c,P).x=$"+(string)x+"^\circ$",T*p,E);
dot(angpoint(c,x),1mm+red);

p=t*p;
/* View the definition of abscissa curabscissa(arc,point) */
x=curabscissa(c,M).x;
dot(curpoint(c,x),1mm+red);
label("curabscissa(c,M).x="+(string)x,p,E);
x=curabscissa(c,P).x;
label("curabscissa(c,P).x="+(string)x,T*p,E);
dot(curpoint(c,x),1mm+red);

p=t*p;
/* View the definition of abscissa nodabscissa(arc,point) */
x=nodabscissa(c,M).x;
label("nodabscissa(c,M).x="+(string)x,p,E);
dot(point(c,x),1mm+red);
label("nodabscissa(c,P).x= \scriptsize{ERROR (point is not on the arc!)}",T*p,E);

p=t*p;
/* View the definition of abscissa relabscissa(arc,point) */
x=relabscissa(c,M).x;
label("relabscissa(c,M).x="+(string)x,p,E);
dot(relpoint(c,x),1mm+red);
x=relabscissa(c,P).x;
label("relabscissa(c,P).x="+(string)x,T*p,E);
dot(relpoint(c,x),1mm+red);

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0960

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

Figure 0096
(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

Figure 0097
(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 – fig0980

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

Figure 0098
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(6cm,0);

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

point A=(-1,1);
dot("$A$",A,S);

arc a=arc(circle(A,2), 45, 270);
draw(a,linewidth(3mm),ArcArrow(5mm));

/* View the definition of arc arc(explicit arc,abscissa,abscissa) */
draw(arc(a,angabscissa(135),angabscissa(225)),1mm+red,ArcArrow(3mm),TrueMargin(0,0.5mm));

Étiquettes : , , , ,


Asymptote using geometry.asy – fig0990

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

Figure 0099
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(6cm,0);

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

point A=(-1,1);
dot("$A$",A,S);

arc a=arc(ellipse(A,2,1,45), 45, 270, fromCenter);
draw(a,linewidth(3mm),ArcArrow(5mm));

/* View the definition of arc arc(explicit arc,abscissa,abscissa) */
draw(arc(a,angabscissa(135),angabscissa(225)),1mm+red,ArcArrow(3mm),TrueMargin(0,0.5mm));

Étiquettes : , , , ,


Asymptote using geometry.asy – fig1000

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

Figure 0100
(Compiled with Asymptote version 2.14svn-r5318)
    
import geometry;
size(6cm,0);

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

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

/* View the definition of arc arccircle(point,point,point) */
arc AMB=arccircle(A,M,B);
draw(AMB,linewidth(3mm),Arrow(5mm),TrueMargin(0,0.5mm));
dot("$C$",AMB.el.C);
draw(arccircle(A,B,M),1mm+red,Arrow(3mm));

dot("$A$",A,2SW,blue);
dot("$B$",B,2E,blue);
dot("$M$",M,2N,blue);

Étiquettes : , , , , ,


Asymptote using geometry.asy – fig1010

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

Figure 0101
(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

Figure 0102
(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

Figure 0103
(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

Figure 0104
(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

Figure 0105
(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 – fig1060

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

Figure 0106
(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);

point A=(1,2);
point B=A+(2,0);
dot("$A$",A,0.25S+2W,red);
dot("$B$",B,0.25S+2E,red);

for (int i=0; i < 2; ++i) {
  real a=(i == 0) ? 60 : -100;
  /* View the definition of point arcsubtendedcenter(point,point,real) */
  dot(arcsubtendedcenter(A,B,a),2mm+blue);
  
  point arccenter=arcsubtendedcenter(A,B,a/2);
  dot(arccenter,2mm+red);

  /* View the definition of arc arcsubtended(point,point,real) */
  arc arcsubtended=arcsubtended(A,B,a);
  draw(arcsubtended,blue);

  arc arc=arcsubtended(A,B,a/2);
  draw(arc,red);
  
  point M=relpoint(arcsubtended,0.75);
  dot(format("%0g",degrees(B-M)-degrees(A-M)),
      M,(-1)^(i+1)*I*dir(arcsubtended,reltime(arcsubtended,0.6)));
  draw(A--M--B,blue);

  label(format("%0g",degrees(B-arccenter)-degrees(A-arccenter)),
      arccenter,(-1)^(i+1)*S);
  draw(A--arccenter--B,red);
 }

Étiquettes : , ,


Asymptote using geometry.asy – fig1070

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

Figure 0107
(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);

/* View the definition of struct mass */
mass A=mass((1,0),3);/* View the definition of mass mass(point,real) */

mass B=mass((0,1),sqrt(3));
point C=(0.25,0);

/* View the definition of void dot(picture,Label,mass,align,string,pen) */
dot("$\left(B;\sqrt{3}\right)$",B,N,format="");

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

/* View the definition of mass masscenter(... mass[]) */
dot("G",masscenter(A,B,mass(C)),S);

Étiquettes : , , ,


Asymptote using geometry.asy – fig1080

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

Figure 0108
(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);

/* View the definition of triangle triangleabc(real,real,real,real,point) */
triangle t=triangleabc(3,4,5);
/* View the definition of void show(picture,Label,Label,Label,Label,Label,Label,triangle,pen,filltype) */
show(La="3", Lb="4", Lc="5",t);

Étiquettes : ,


Asymptote using geometry.asy – fig1090

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

Figure 0109
(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);

/* View the definition of triangle triangleAbc(real,real,real,real,point) */
triangle t=triangleAbc(60,3,5,angle=90);
show(Lb="3", Lc="5",t);
markangle("$60^\circ$",t.B,t.A,t.C);

Étiquettes : , ,


Asymptote using geometry.asy – fig1100

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

Figure 0110
(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));
/* View the definition of void label(picture,Label,Label,Label,triangle,real,real,pen,filltype) */
label(t, alignFactor=4);

/* View the definition of triangle anticomplementary(triangle) */
triangle at=anticomplementary(t);
draw(at, bp+0.8green);
label("$A'$", "$B'$", "$C'$", at, blue);

draw(segment(at.AB), bp+0.8green, StickIntervalMarker(2,1));
draw(segment(at.BC), bp+0.8green, StickIntervalMarker(2,2));
draw(segment(at.CA), bp+0.8green, CrossIntervalMarker(2,3));

Étiquettes : , , , ,


Asymptote using geometry.asy – fig1110

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

Figure 0111
(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

Figure 0112
(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);

markangle(sA, (line) t.AC, radius=2cm, StickIntervalMarker(1,1));
markangle((line) t.AB, mA, radius=2cm, StickIntervalMarker(1,1));
markangle(mA, sA, radius=10cm, StickIntervalMarker(2,2));

Étiquettes : , , , , ,


Asymptote using geometry.asy – fig1130

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

Figure 0113
(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

Figure 0114
(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

Figure 0115
(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

Figure 0116
(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

Figure 0117
(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 – fig0060

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

Figure 0006

Here an other example with the incircle of a triangle.
Further examples follow...

(Compiled with Asymptote version 1.87svn-r4652)
    
import trembling;
startTrembling(angle=6, random=10);

size(8cm);

triangle T=triangleabc(6,7,8);
dot(intouch(T));

draw(T);
draw(incircle(T), 0.8*red);

Étiquettes : , , ,


Asymptote using trembling.asy – fig0070

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

Figure 0007
(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);

addMargins(1cm,1cm);

Étiquettes : , , , ,


Asymptote using trembling.asy – fig0080

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

Figure 0008
(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);

addMargins(1cm,1cm);

Étiquettes : , , , , ,


Asymptote using trembling.asy – fig0110

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

Figure 0011

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

Figure 0012

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

Figure 0013
(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 : , , , , , , , , , ,


Fractals with Asymptote – fig0110

Category: Asymptote,Examples 2D,FractalsPh. Ivaldi @ 7 h 53 min

Figure 0011
(Compiled with Asymptote version 1.87svn-r4652)
    
/* Explanations HERE */
import geometry;
size(10cm,0);

triangle[] dissect(triangle T, int n)
{
  if(n <= 0) return new triangle[]{T};
  triangle[] OT;
  point M=midpoint(T.BC);
  triangle[] Tp=dissect(triangle(M,T.A,T.B),n-1);
  for(triangle t : Tp) OT.insert(0,t);
  triangle[] Tp=dissect(triangle(M,T.C,T.A),n-1);
  for(triangle t : Tp) OT.insert(0,t);
  return OT;
}

triangle T=rotate(45)*triangle((1,1),(0,0),(2,0));
triangle[] DT=dissect(T,9);
path g;
transform R=reflect(T.BC);

for(int i : DT.keys) {
  draw(DT[i],miterjoin+0.9*red);
  draw(R*DT[i],miterjoin+0.9*red);
  g=g--centroid(DT[i]);
}

draw(scale(sqrt(2))*unitsquare,bp+miterjoin+0.8*blue);
draw(g--reverse(R*g)--cycle,bp+miterjoin+yellow);

shipout(bbox(sqrt(2)*mm, Fill(black)));

Étiquettes : , , , , ,


Fractals with Asymptote – fig0120

Category: Asymptote,Examples 2D,FractalsPh. Ivaldi @ 8 h 53 min

Figure 0012
(Compiled with Asymptote version 1.87svn-r4652)
    
/* Explanations HERE */
size(12cm,0);

import geometry;

triangle T=triangleAbc(90,Tan(30),1);

triangle[] reverse(triangle[] arr)
{
  triangle[] or;
  int l=arr.length;
  for(int i=0; i < l; ++i) {
    or.push(arr[l-i-1]);
  }
  return or;
}

triangle[] dissect(triangle T, int n, bool reverse=false)
{
  if(n <= 0) return new triangle[]{T};
  triangle[] OT;

  point M=curpoint(T.AB,T.b()*Tan(30));
  point H=projection(T.BC)*M;
  triangle[] OT1, OT2, OT3;
  OT.append(dissect(triangle(H,T.B,M),n-1,!reverse));
  OT.append(reverse((dissect(triangle(H,T.C,M),n-1,!reverse))));
  OT.append(dissect(triangle(T.A,T.C,M),n-1,!reverse));
  return OT;
}

triangle[] DT=dissect(T,5);
point O=centroid(DT[0]);
path g;
transform Ro=rotate(30,T.B), Re=reflect(T.BC), Roj;

for(int i : DT.keys) {
  O=incenter(DT[i]);
  g=g--O;
}

g=reverse(g);
path G, g=g--Re*reverse(g) ;
for (int j=0; j < 12; j += 2) G=G--Ro^(-j)*g;

fill(G--cycle,0.3*blue);

for(int i : DT.keys) {
  for (int j=0; j < 12; j += 2) {
    Roj=Ro^j;
    draw(Roj*DT[i],miterjoin+0.8*red);
    draw(Roj*(Re*DT[i]),miterjoin+0.8*red);
  }
}

draw(G--cycle,bp+miterjoin+0.9*yellow);

shipout(bbox(2mm, FillDraw(black, 1mm+miterjoin+deepblue)));

Étiquettes : , , , , ,


Official Asymptote example – Pythagoras

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

Figure 0176
(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 – cosaddition

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

Figure 0038
(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 – markers2

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

Figure 0140
(Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */
    
size(10cm,0);
import markers;
import geometry;
import math;

pair A=0, B=(1,0), C=(0.7,1), D=(-0.5,0), F=rotate(-90)*(C-B)/2+B;

draw(A--B);
draw(A--C);
pen p=linewidth(1mm);
draw(B--C,p);
draw(A--D);
draw(B--F,p);
label("$A$",A,SW);
label("$B$",B,S);
label("$C$",C,N);
dot(Label("$D$",D,S));
dot(Label("$F$",F,N+NW));

markangle(A,C,B);

markangle(scale(1.5)*"$\theta$",radius=40,C,B,A,ArcArrow(2mm),1mm+red);
markangle(scale(1.5)*"$-\theta$",radius=-70,A,B,C,ArcArrow,green);

markangle(Label("$\gamma$",Relative(0.25)),n=2,radius=-30,A,C,B,p=0.7blue+2);

markangle(n=3,B,A,C,marker(markinterval(stickframe(n=2),true)));

pen RedPen=0.7red+1bp;
markangle(C,A,D,RedPen,marker(markinterval(2,stickframe(3,4mm,RedPen),true)));
drawline(A,A+dir(A--D,A--C),dotted);

perpendicular(B,NE,F-B,size=10mm,1mm+red,
              TrueMargin(linewidth(p)/2,linewidth(p)/2),Fill(yellow));

Étiquettes : ,


Official Asymptote example – orthocenter

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

Figure 0154
(Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */
    
import geometry;
import math;

size(7cm,0);

real theta=degrees(asin(0.5/sqrt(7)));

pair B=(0,sqrt(7));
pair A=B+2sqrt(3)*dir(270-theta);
pair C=A+sqrt(21);
pair O=0;

pair Ap=extension(A,O,B,C);
pair Bp=extension(B,O,C,A);
pair Cp=extension(C,O,A,B);

perpendicular(Ap,NE,Ap--O,blue);
perpendicular(Bp,NE,Bp--C,blue);
perpendicular(Cp,NE,Cp--O,blue);

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

currentpen=black;

draw("1",A--O,-0.25*I*dir(A--O));
draw(O--Ap);
draw("$\sqrt{7}$",B--O,LeftSide);
draw(O--Bp);
draw("4",C--O);
draw(O--Cp);

dot("$O$",O,dir(B--Bp,Cp--C),red);
dot("$A$",A,dir(C--A,B--A),red);
dot("$B$",B,NW,red);
dot("$C$",C,dir(A--C,B--C),red);
dot("$A'$",Ap,dir(A--Ap),red);
dot("$B'$",Bp,dir(B--Bp),red);
dot("$C'$",Cp,dir(C--Cp),red);

label(graphic("piicon","width=2.5cm"),Ap,5ENE,red);

Étiquettes : , ,


Official Asymptote example – triangle

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

Figure 0240
(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 : , , ,


Animation with Asymptote – fig0020

Category: Animation,AsymptotePh. Ivaldi @ 9 h 20 min

Figure 0002
(Compiled with Asymptote version 1.43)
Movie flash (swf)
This animation is available in the Syracuse web site.
    
import geometry;
import animate;
settings.tex="pdflatex";

animation A;
size(12cm);

for (int a=1; a < 20; ++a) {
  save();
  point P=(-4.5,0); dot(P);
  inversion inv=inversion(1,P);
  line l1=line((0,0),(-0.35,1)), l2=line((0,0),(0.35,1));
  path g1=inv*l1, g2=inv*l2;
  fill(g1^^g2,evenodd+lightgrey); draw(g1,linewidth(bp));
  draw(g2,linewidth(bp));

  for (int i:new int[]{-1,1}) {
    point P=(0,3i/a);
    triangle t=triangle(shift(P)*hline,l1,l2);
    int n=a;
    for (int j=0; j <= n; ++j) {
      circle C=excircle(t.AB);
      t=triangle(shift(angpoint(C,i*90))*hline,l1,l2);
      circle Cp=inv*C;
      path g=Cp;
      fill(g,0.95*yellow);
      draw(g,bp+red); draw(g,blue);
    }
  }
  picture pic;
  add(pic,bbox(5mm,Fill(rgb(0.95,0.95,0.8))));
  A.add(pic);
  restore();
}

A.pdf(keep=true);

Étiquettes : , ,


Animation with Asymptote – fig0030

Category: Animation,AsymptotePh. Ivaldi @ 10 h 20 min

Figure 0003
(Compiled with Asymptote version 1.43)
This animation is available in the Syracuse web site.
    
import geometry;
import animate;
animation A;

size(15cm);

int nAnim=75;
int nCircle=6;
real astep=360/nAnim;

inversion inv=inversion((-1,-2),1);
line L1=line(N,S);
circle C=inv*L1;
point center=C.C;

for (int i=-nAnim; i < nAnim; ++i) {
  real r;
  r=0.001+4*(i/nAnim)^2;
  line L2=shift(2*r*E)*L1;
  transform T=shift(0,-2*r);
  transform R=rotate(astep*i,center);
  circle C0=circle(r*E+nCircle/2*sqrt(r)*N,r);
  circle[] Ci=sequence(new circle(int i){return T^i*C0;}, nCircle);

  fill(R*(path)C, 0.3*blue);
  circle Cl=R*(inv*L2);
  transform dsh=shift(Cl.r/3*unit(center-Cl.C));
  radialshade((path)Cl,white,dsh*Cl.C,0,black,dsh*Cl.C,Cl.r);
  for (int i=0; i < Ci.length; ++i) {
    circle Ct=inv*Ci[i];
    transform dsh=shift(Ct.r/3*unit(center-Ct.C));
    radialshade(R*(path)Ct,red,dsh*R*Ct.C,0,black,dsh*R*Ct.C,Ct.r);
  }
  A.add();
  erase();
}

A.movie(BBox(2mm,Fill(black)));

Étiquettes : , ,


Animation with Asymptote – fig0040

Category: Animation,AsymptotePh. Ivaldi @ 11 h 20 min

Figure 0004
(Compiled with Asymptote version 1.43)
Movie flash (swf)
This animation is available in the Syracuse web site.
    
import geometry;
import animate;
settings.tex="pdflatex";
settings.outformat="pdf";

animation Anim;

size(10cm,0);

circle C=circle(origin,1);
draw(C);
point A=point(C,0), B, M;
guide locus;


for (real a=0.001; a < 360; a += 5) {
  save();
  B=angpoint(C,a);
  triangle t=triangle(origin,A,B);
  draw(t);
  draw(incircle(t), bp+0.8*blue);
  triangle intouch=intouch(t);
  draw(intouch, dot);
  M=intouch(t.AC);
  label("$N$", Label("$M$", 0.8*red), "$P$", intouch);
  dot(M, 0.8*red);
  locus=locus..M;
  draw(locus, bp+0.8*red);
  Anim.add();
  restore();
}

// Anim.movie();
Anim.pdf(keep=true);


Étiquettes : , , , ,


Animation with Asymptote – fig0110

Category: Animation,AsymptotePh. Ivaldi @ 18 h 20 min

Figure 0011
(Compiled with Asymptote version 1.86svn-r4626)
Movie flash (swf)
This animation is available in the Syracuse web site.
    
import geometry;
import animate;
// settings.tex="pdflatex";
// settings.outformat="pdf";

animation anim;
size(12cm);

point F1=(0,0), F2=(0,-3);
dot("F",F1);

ellipse el1=ellipse(F1,F2,2), el2;
point Fp1=shift(0,2*el1.a)*F1;
dot("F'",Fp1);

line tgt, saxe=line(F1,false,-F2);

for (int i=0; i < 360; i += 5) {
  save();
  ellipse el=rotate(i,F1)*el1;
  point M=intersectionpoints(el,saxe)[0];
  tgt=tangents(el,M)[0];
  draw(tgt, 0.8*red);
  draw((reflect(tgt)*el)^^el, linewidth(bp));
  anim.add();
  restore();
}
erase();
anim.movie();

Étiquettes : , , ,


Animation with Asymptote – fig0120

Category: Animation,AsymptotePh. Ivaldi @ 19 h 20 min

Figure 0012
(Compiled with Asymptote version 1.86svn-r4626)
Movie flash (swf)
This animation is available in the Syracuse web site.
    
import geometry;
import animate;
settings.tex="pdflatex";
settings.outformat="pdf";

animation anim;
size(12cm);



point F1=(0,0), F2=(10,0);
dot("F",F2);
ellipse el1=ellipse(F1,F2,6), el2;
draw(el1, linewidth(bp));
point Fp2=shift(2*el1.a,0)*F2;
line tgt, saxe;
pen[] p=new pen[]{0.8*green,0.8*blue,0.8*yellow,cyan};
path[] locus=sequence(new path(int i){return nullpath;},p.length);
real t=1/(p.length-1);

bool initlocus=true;
for (int i=0; i < 360; i += 1) {
  save();
  point Fm=rotate(i,F2)*Fp2;
  dot("F'",Fm);
  draw(Fm--F2, linewidth(2bp));
  point M=intersectionpoints(el1, line(F2,false,Fm))[0];
  tgt=tangents(el1,M)[0];
  draw(tgt, 0.8*red);
  el2=reflect(tgt)*el1;
  draw(el2.F1--el2.F2);

  for (int j=0; j < p.length; ++j) {
    point P=point(segment(el2.F2,Fm),0.5+j*t/2);
    locus[j]=initlocus ? P : locus[j]--P;
    dot(P, p[j]);
    draw(locus[j], bp+p[j]);
  }

  dot(el2.F2);
  draw(el2, linewidth(bp));
  anim.add();
  restore();
  initlocus=false;
}
erase();
anim.movie();

Étiquettes : , , , ,


Animation with Asymptote – fig0130

Category: Animation,AsymptotePh. Ivaldi @ 20 h 20 min

Figure 0013
(Compiled with Asymptote version 1.86svn-r4626)
Movie flash (swf)
This animation is available in the Syracuse web site.
    
// From an idea posted by Fabrice Couvreur
import geometry;
import animate;
settings.tex="pdflatex";
settings.outformat="pdf";

point A=(0,0), B=(8,0), C=(8,10);
unitsize(5cm/B.x,5cm/C.y);
animation Anim,Anim1;
path locus;

triangle t=triangle(A,B,C);
transform proj=projection(t.BC);
draw(t,linewidth(bp));
label(t);
segment s=segment(t.AB);
line l1 =line(t.BC);

int n=50; // Points number of the locus
real a=0, step=1/(n-1);
for (int i=0; i < n; ++i) {
  save(); // Geometry part
  point M=point(s,a);
  line l2=parallel(M,l1);
  point Np=intersectionpoint(l2,t.AC);
  point P=proj*Np;
  dot("$M$",M,S,0.8*red);
  dot("$P$",P,E,0.8*red);
  dot("$N$",Np,W,0.8*red);
  fill(M--Np--P--B--cycle,0.8*red);
  perpendicularmark(t.BC,t.BA);
  Anim.add(); // Anim contain only the geometry part
  restore();
  // Graph part
  picture gph; // picture of the graph
  unitsize(gph,5cm/B.x,4cm/C.y); // units for the graph
  show(gph,currentcoordsys);
  point Sp=(a*abs(B-A),abs(M-B)*abs(M-Np));
  locus=locus..Sp;
  draw(gph,locus, bp+0.8*red);
  Anim1.add(gph); // Anim1 contain only the graph part
  a += step;
}

Anim1.export(); // make all Anim1 pictures to the same size.
Anim1.purge();

for (int i=0; i < Anim.pictures.length; ++i) {
  // draw axis on all pictures of Anim1
  draw(Anim1.pictures[i],Label("$x$",align=S,position=EndPoint),hline,Arrow);
  draw(Anim1.pictures[i],Label("$y$",align=W,position=EndPoint),vline,Arrow);
  // add each graph to the corresponding geometric picture
  add(Anim.pictures[i],Anim1.pictures[i].fit(),1.25*B);
}

Anim.movie();

Étiquettes : , ,


Animation with Asymptote – fig0180

Category: Animation,AsymptotePh. Ivaldi @ 1 h 20 min

Figure 0018
(Compiled with Asymptote version 1.86svn-r4626)
Movie flash (swf)
This animation is available in the Syracuse web site.
    
// pdf version of this animation: fig0180.pdf
import labelpath;
import animate;
animation A;

texpreamble("\usepackage[dvips,pdfpagemode=FullScreen]{hyperref}");
settings.outformat="pdf";
settings.tex="pdflatex";
defaultpen(fontsize(12pt));

size(16cm,0);
usepackage("mathrsfs, amsfonts,amsmath,amssymb");
picture pic, pic1, pic2, pic3;
real u=1, Y=2*pi+0.5;
pair yM=(u,Y*u), ym=(u,-Y*u);
path cle=scale(u)*unitcircle;
path arcg=arc((0,0),1.5*u,115,155);

void addtick(picture pic=currentpicture, Label L, pair z, pair dir=E, pen p=currentpen)
{
  transform R=rotate(degrees(dir));
  real width=1.5mm;
  Label L=L.copy();
  L.position(z);
  L.align(NoAlign,E);
  L.align.dir=R*L.align.dir*1.3*width/mm;
  L.p(p);
  pic.add(new void(frame f, transform t) {
      path g=(-width,0)--(width,0);
      picture opic;
      draw(opic,shift(t*z)*R*g,p);
      add(f,opic.fit());
    });
  add(pic,L);
}

path roll(picture pic=currentpicture, real x, int nb=50)
{
  real stp=x/(nb-1);
  return operator --(...
                     sequence(new guide(int t){
                         real tt=t*stp;
                         return shift(expi(tt))*((x-tt)*(-sin(tt),cos(tt)));
                       },nb));
}

pair EW(int sign){return sign > 0 ? E : W;}

string pm(int sign){return sign > 0 ? "" : "-";}

pen p(int sign){return sign > 0 ? red : blue;}
pen pw(int sign){return p(sign)+(sign > 0 ? currentpen : white);}

// Define common picture
draw(scale(1.25)*"+", arcg, Arrow());
dot("$0$", point(cle,0));

draw((-u,0)--(u,0)^^(0,-u)--(0,u));
draw("$1$",(0,0)--point(cle,1.5),Arrows(FillDraw(white)));

pic.add(currentpicture);// Save the common picture in 'pic'.

// Starting picture 1
draw((u,0)--yM, linewidth(bp)+p(1), Arrow(TeXHead));
draw(ym--(u,0), linewidth(bp)+p(-1));
arrow("\underline{Axe des réels}",(u,-0.75*Y*u),W,1cm);

real x=2.2, y=-x, maxe=2*pi+0.2;
addtick(Label("$1$",align=E), (u,1), p(1));
addtick(Label("$\frac{\pi}{2}$",align=E), (u,pi/2), p(1));
addtick(Label("$\pi$",align=E), (u,pi), p(1));
addtick(Label("$\frac{3\pi}{2}$",align=E), (u,3pi/2), p(1));
addtick(Label("$2\pi$",align=E), (u,2pi), p(1));
addtick(Label("$-1$",align=W), (u,-1), p(-1));
addtick(Label("$-\frac{\pi}{2}$",align=W), (u,-pi/2), p(-1));
addtick(Label("$-\pi$",align=W), (u,-pi), p(-1));
addtick(Label("$-\frac{3\pi}{2}$",align=W), (u,-3pi/2), p(-1));
addtick(Label("$-2\pi$",align=W), (u,-2pi), p(-1));

draw(Label("$\mathscr{C}$",Relative(0.625)), cle,linewidth(bp));
A.add();
erase();

// Define the common picture for rolling part.
picture picanim(int sign)
{
  picture opic=pic.copy();
  pen pmoins=sign > 0 ? p(-1) : p(-1)+white;
  draw(opic, (u,0)--yM, bp+white+p(1), Arrow(TeXHead));
  draw(opic, ym--(u,0), linewidth(bp)+pmoins);
  arrow(opic,"\underline{Axe des réels}", (u,-0.75*Y*u), W, 1cm);
  addtick(opic, Label("$1$",align=E), (u,1), white+p(1));
  addtick(opic, Label("$\frac{\pi}{2}$",align=E), (u,pi/2), white+p(1));
  addtick(opic, Label("$\pi$",align=E), (u,pi), white+p(1));
  addtick(opic, Label("$\frac{3\pi}{2}$",align=E), (u,3pi/2), white+p(1));
  addtick(opic, Label("$2\pi$",align=E), (u,2*pi), white+p(1));
  addtick(opic, Label("$-1$",align=W), (u,-1), pmoins);
  addtick(opic, Label("$-\frac{\pi}{2}$",align=W), (u,-pi/2), pmoins);
  addtick(opic, Label("$-\pi$",align=W), (u,-pi), pmoins);
  addtick(opic, Label("$-\frac{3\pi}{2}$",align=W), (u,-3pi/2), pmoins);
  addtick(opic, Label("$-2\pi$",align=W), (u,-2*pi), pmoins);
  return opic;
}

erase();
pic2=picanim(1);

int nb=50; // Number of picture for rolling.
real step=maxe/nb;

for (int sign=1; sign > -2; sign -= 2) {// Rolling axis part (1 for positive values, -1 for ...);
  guide r1,rpis2, rpi, rpi32, rpi2;
  pair z;
  for (int i=0; i <= nb ; ++i) {
    real t=sign*i*step; // Where is the tangency.

    if(sign > 0) draw(Label("$\mathscr{C}$",Relative(0.625)), cle,linewidth(bp));
    path tg=i == nb ? cle : arc((0,0),u,0,degrees(t)); // The rolled part.
    path g=u*expi(t)--shift(u*expi(t))*((Y-abs(t))*u*expi(sign*pi/2+t)); // The straight part.
    draw(g,linewidth(bp)+p(sign), sign > 0 ? Arrow(TeXHead) : None);

    if(t > 0) {
      if(abs(t) <= 1) {
        z=arcpoint(g, (1-abs(t))*u);
        addtick(Label(pm(sign)+"$1$",align=EW(sign)), z, expi(sign), p(sign));
        r1=r1..z;
      } else addtick(Label(pm(sign)+"$1$",align=EW(sign), UnFill),
                     u*(cos(sign),sin(sign)), dir(degrees(sign*1.0)), p(sign));}

    draw(r1, dashed+p(sign));

    if(abs(t) <= pi/2) {
      z=arcpoint(g,(pi/2-abs(t))*u);
      addtick(Label("$"+pm(sign)+"\frac{\pi}{2}$",align=EW(sign)), z, expi(t), p(sign));
      rpis2=rpis2..z;
    } else addtick(Label("$"+pm(sign)+"\frac{\pi}{2}$",align=EW(sign), UnFill),
                   (0,sign*u), sign*N, p(sign));

    draw(rpis2, dashed+p(sign));

    if(abs(t) <= pi) {
      z=arcpoint(g,(pi-abs(t))*u);
      addtick(Label("$"+pm(sign)+"\pi$",align=EW(sign)), z, expi(t), p(sign));
      rpi=rpi..z;
    } else addtick(Label("$"+pm(sign)+"\pi$",align=EW(sign), UnFill),
                   (-u,0), W, p(sign));

    draw(rpi,dashed);

    if(abs(t) <= 3*pi/2) {
      z=arcpoint(g,(3pi/2-abs(t))*u);
      addtick(Label("$"+pm(sign)+"\frac{3\pi}{2}$",align=EW(sign)), z, expi(t), p(sign));
      rpi32=rpi32..z;
    } else addtick(Label("$"+pm(sign)+"\frac{3\pi}{2}$",align=EW(sign), UnFill),
                   (0,-sign*u), sign*S, p(sign));

    draw(rpi32, dashed+p(sign));

    if(abs(t)-2*pi < -1e-5) {
      z=arcpoint(g,(2*pi-abs(t))*u);
      addtick(Label("$"+pm(sign)+"2\pi$",align=EW(sign)), z, expi(t), p(sign));
      rpi2=rpi2..z;
    } else addtick(Label("$"+pm(sign)+"2\pi$",align=(sign > 0 ? 2 : 1)*EW(sign), UnFill),
                   (u,0), E, p(sign));

    draw(rpi2, dashed+p(sign));

    if(i == nb && sign == 1) {
      draw(tg,linewidth(2*bp)+p(sign));
      pic3.add(currentpicture);
      add(pic2);
      pic2=picanim(-1);
      pic2.add(pic3);
    } else add(pic2); // Add the common picture 'pic2'.

    draw(tg,linewidth(bp)+p(sign));
    A.add();
    if(sign > 0 || i != nb) erase();
  }
}

for (int i=0; i < 10; ++i) A.add();
clip(scale(1.6)*cle);
for (int i=0; i < 10; ++i) A.add();

eval(quote{
    addtick(Label("$-\pi$",align=EW(-1), UnFill), (-u,0), W, p(-1));
    addtick(Label("$-2\pi$",align=EW(-1), UnFill), (u,0), E, p(-1));
    defaultfilename='temp_';
    shipout(currentpicture.fit(scale(2cm)));},true);

pair center=(min(currentpicture)+max(currentpicture))/2;
int n=20;
for (int i=0; i <= n; ++i) {
  erase();
  label(scale(1+1.25*i/n)*graphic("temp_.pdf"),i/n*center);
  A.add();
}

for (int i=0; i < 20; ++i) A.add();
for (int i=0; i < 10; ++i) A.add(A.pictures[0]); // Add the first picture in the animation.

A.movie();

Étiquettes : , ,