🔗Asymptote Gallery Tagged by “Pair” #6
🔗geometry-fig001

Show geometry/fig0010.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Pair
size(8cm,0); import geometry; /*<asyxml><view file="modules/geometry.asy" type="" signature="struct coordsys"/></asyxml>*/ show(currentcoordsys); pair a=(0,0.5), b=(1,0.5); /*<asyxml><view file="modules/geometry.asy" type="" signature="struct point"/></asyxml>*/ point A=a, B=b; dot("$A$",A); dot("$B$",B);
🔗geometry-fig002

Show geometry/fig0020.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Pair
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); /*<asyxml><view file="modules/geometry.asy" type="coordsys" signature="cartesiansystem(pair,pair,pair)"/></asyxml>*/ 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; /*<asyxml><view file="modules/geometry.asy" type="point" signature="point(coordsys,explicit point)"/></asyxml>*/ point Bp=point(currentcoordsys,B); // same as 'point Bp=b;' dot("$A'$",Ap); dot("$B'$",Bp); dot("$M$",(Ap+Bp)/2);
🔗geometry-fig003

Show geometry/fig0030.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Pair
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); /*<asyxml><view file="modules/geometry.asy" type="coordsys" signature="cartesiansystem(pair,pair,pair)"/></asyxml>*/ 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; /*<asyxml><view file="modules/geometry.asy" type="point" signature="point(coordsys,explicit point,real)"/></asyxml>*/ point Bp=point(currentcoordsys,B); // same as 'point Bp=b;' dot("$A'$",Ap); dot("$B'$",Bp); dot("$M$",(Ap+Bp)/2); draw(Ap--Bp); /*<asyxml><view file="modules/geometry.asy" type="point" signature="locate(pair)"/></asyxml>*/ draw(locate((0,0))--Bp,blue); /*<asyxml><view file="modules/geometry.asy" type="pair" signature="locate(point)"/></asyxml>*/ draw((0,0)--locate(Bp),0.8*green);
🔗geometry-fig004

Show geometry/fig0040.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Pair | #Point/Dot
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); /*<asyxml><view file="modules/geometry.asy" type="point" signature="point(coordsys,pair,real)"/></asyxml>*/ dot("",point(R,m),red); // Same as 'dot("",m,red);' dot("",point(Rp,m),blue); point M=m; /*<asyxml><view file="modules/geometry.asy" type="point" signature="point(coordsys,explicit point,real)"/></asyxml>*/ 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) /*<asyxml><view file="modules/geometry.asy" type="pair" signature="/(pair,coordsys)"/></asyxml>*/ 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. /*<asyxml><view file="modules/geometry.asy" type="point" signature="changecoordsys(coordsys,point)"/></asyxml>*/ dot("$P''$",changecoordsys(Rpp,P),2W,1.5mm+green); // Useful for 'point'.
🔗geometry-fig005

Show geometry/fig0050.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Pair
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); /*<asyxml><view file="modules/geometry.asy" type="pair" signature="locate(explicit vector)"/></asyxml>*/ draw("$\overrightarrow{w}$", (0,0)--locate(w), W,Arrow);
🔗geometry-fig007

Show geometry/fig0070.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Pair | #Transform/scale/shift/rotate
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); /*<asyxml><view file="modules/geometry.asy" type="transform" signature="scale(real,point,point,point,point,bool)"/></asyxml>*/ transform t=scale(2,A,B,A,C); /*<asyxml><view file="modules/geometry.asy" type="transform" signature="projection(point,point,point,point,bool)"/></asyxml>*/ 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);
🔗geometry-fig008

Show geometry/fig0080.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Pair | #Vector
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));
🔗geometry-fig009

Show geometry/fig0090.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Pair | #Vector
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);
🔗geometry-fig010

Show geometry/fig0100.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Pair | #Vector
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);
🔗geometry-fig026

Show geometry/fig0260.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Path | #Point | #Pair
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); /*<asyxml><view file="modules/geometry.asy" type="bool" signature="@(point,line)"/></asyxml>*/ write(N@l);// Return 'false' /*<asyxml><view file="modules/geometry.asy" type="bool" signature="onpath(picture,path,point,pen)"/></asyxml>*/ write(onpath(g,N,p));// Return 'true' write(onpath(g,P,p));// Return 'false'