🔗Asymptote Gallery Tagged by “Draw (2D)” #4
đź”—geometry-fig016

Show geometry/fig0160.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Line | #Draw (2D)
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); /*<asyxml><view file="modules/geometry.asy" type="" signature="struct line"/></asyxml>*/ line l1=line(A,B);/*<asyxml><view file="modules/geometry.asy" type="line" signature="line(point,bool,point,bool)"/></asyxml>*/ /*<asyxml><view file="modules/geometry.asy" type="void" signature="draw(picture,Label,line,bool,bool,align,pen,arrowbar,Label,marker)"/></asyxml>*/ 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)); }
đź”—geometry-fig024

Show geometry/fig0240.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Line | #Segment | #Draw (2D)
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); /*<asyxml><view file="modules/geometry.asy" type="" signature="struct segment"/></asyxml>*/ 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}; /*<asyxml><view file="modules/geometry.asy" type="line[]" signature="complementary(explicit segment)"/></asyxml>*/ line[] cs1=complementary(s1); /*<asyxml><view file="modules/geometry.asy" type="void" signature="draw(picture,Label[],line[],align,pen,arrowbar,Label,marker)"/></asyxml>*/ draw(L, cs1, 2mm+lightgrey); draw(box(locate((-2.5,-1)),locate((2.5,1))), invisible);
đź”—geometry-fig033

Show geometry/fig0330.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Draw (2D) | #Clip | #Deferred drawing | #Parabola
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.*/
đź”—geometry-fig034

Show geometry/fig0340.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Draw (2D) | #Clip | #Deferred drawing | #Hyperbola | #Line
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); /*<asyxml><view file="modules/geometry.asy" type="hyperbola" signature="hyperbola(point,point,real,bool)"/></asyxml>*/ 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); /*<asyxml><view file="modules/geometry.asy" type="hyperbola" signature="hyperbola(point,real,real,real)"/></asyxml>*/ draw(hyperbola(h.C, h.a, h.b, h.angle), 2mm+green); /*<asyxml><view file="modules/geometry.asy" type="hyperbola" signature="hyperbola(bqe)"/></asyxml>*/ draw(hyperbola(equation(h)), 1mm+red); /*<asyxml><view file="modules/geometry.asy" type="hyperbola" signature="conj(hyperbola)"/></asyxml>*/ 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));
đź”—geometry-fig076

Show geometry/fig0760.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Ellipse | #Draw (2D) | #Circle | #Parabola | #Hyperbola | #Conic | #Intersection
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); /*<asyxml><view file="modules/geometry.asy" type="void" signature="draw(picture,Label,explicit conic,align,pen,arrowbar,arrowbar,margin,Label,marker)"/></asyxml>*/ 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) /*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(conic,conic)"/></asyxml>*/ dot(intersectionpoints(co[i],co[j]), red); }