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