PIPRIME.FR BLOG

Live fully to honor life

The geometry.asy module exemples with the Asymptote drawing software

Examples using the package geometry.asy of the Asymptote software

🔗geometry-fig001

Figure geometry 001 Generated with Asymptote

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

Figure geometry 002 Generated with Asymptote

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

Figure geometry 003 Generated with Asymptote

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

Figure geometry 004 Generated with Asymptote

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

Figure geometry 005 Generated with Asymptote

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-fig006

Figure geometry 006 Generated with Asymptote

Show geometry/fig0060.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Transform/scale/shift/rotate

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);

/*<asyxml><view file="modules/geometry.asy" type="transform" signature="rotateO(real)"/></asyxml>*/
point Pp=rotateO(90)*P;

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

dot("rotate(90,Pp)*P", rotate(90,Pp)*P, W);
/*<asyxml><view file="modules/geometry.asy" type="transform" signature="scale(real,point)"/></asyxml>*/
dot("scale(-2,Pp)*P", scale(-2,Pp)*P, NE);

/*<asyxml><view file="modules/geometry.asy" type="transform" signature="scaleO(real)"/></asyxml>*/
dot("scaleO(2)*P", scaleO(2)*P,red);
/*<asyxml><view file="modules/geometry.asy" type="transform" signature="xscaleO(real)"/></asyxml>*/
dot("xscaleO(2)*P", xscaleO(2)*P);
/*<asyxml><view file="modules/geometry.asy" type="transform" signature="yscaleO(real)"/></asyxml>*/
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);

🔗geometry-fig007

Figure geometry 007 Generated with Asymptote

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

Figure geometry 008 Generated with Asymptote

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

Figure geometry 009 Generated with Asymptote

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

Figure geometry 010 Generated with Asymptote

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-fig011

Figure geometry 011 Generated with Asymptote

Show geometry/fig0110.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point

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);
}

🔗geometry-fig012

Figure geometry 012 Generated with Asymptote

Show geometry/fig0120.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Vector | #Line

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);

🔗geometry-fig013

Figure geometry 013 Generated with Asymptote

Show geometry/fig0130.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Vector | #Line | #Intersection

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);

🔗geometry-fig014

Figure geometry 014 Generated with Asymptote

Show geometry/fig0140.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Vector | #Line | #Intersection

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);
}

🔗geometry-fig015

Figure geometry 015 Generated with Asymptote

Show geometry/fig0150.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Intersection | #Path

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);

/*<asyxml><view file="modules/geometry.asy" type="pair[]" signature="intersectionpoints(line,path)"/></asyxml>*/
dot(intersectionpoints(l,cle));

🔗geometry-fig016

Figure geometry 016 Generated with Asymptote

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-fig017

Figure geometry 017 Generated with Asymptote

Show geometry/fig0170.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Line | #Parallel | #Perpendicular | #Intersection | #Markers

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);

/*<asyxml><view file="modules/geometry.asy" type="line" signature="parallel(point,line)"/></asyxml>*/
draw(parallel(M,l1),red);

/*<asyxml><view file="modules/geometry.asy" type="line" signature="perpendicular(point,line)"/></asyxml>*/
line perp=perpendicular(M,l1);
draw(perp);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="intersectionpoint(line,line)"/></asyxml>*/
point interp=intersectionpoint(l1,perp);
dot(interp,green);

/*<asyxml><view file="modules/geometry.asy" type="void" signature="markrightangle(picture,point,point,point,real,pen,margin,filltype)"/></asyxml>*/
markrightangle(l1.A,interp,rotate(180,interp)*M,size=5mm);

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

🔗geometry-fig018

Figure geometry 018 Generated with Asymptote

Show geometry/fig0180.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Line | #Parallel | #Perpendicular | #Transform/scale/shift/rotate

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);

/*<asyxml><view file="modules/geometry.asy" type="transform" signature="projection(line)"/></asyxml>*/
point P=projection(l1)*M;
dot("$P$",P,2W);
draw(M--P);
markrightangle(l1.A,P,M);


/*<asyxml><view file="modules/geometry.asy" type="transform" signature="vprojection(line,bool)"/></asyxml>*/
point Q=vprojection(l1)*M;
dot("$Q$",Q,2W);
draw(M--Q);

/*<asyxml><view file="modules/geometry.asy" type="transform" signature="hprojection(line,bool)"/></asyxml>*/
point R=hprojection(l1)*M;
dot("$R$",R,2W);
draw(M--R);

/*<asyxml><view file="modules/geometry.asy" type="transform" signature="projection(line,line,bool)"/></asyxml>*/
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);

🔗geometry-fig019

Figure geometry 019 Generated with Asymptote

Show geometry/fig0190.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Point | #Line | #Parallel | #Transform/scale/shift/rotate

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);

/*<asyxml><view file="modules/geometry.asy" type="line" signature="line(real,point)"/></asyxml>*/
line l2=line(100,C);
draw(l2,blue);
dot("$C$",C);

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

/*<asyxml><view file="modules/geometry.asy" type="transform" signature="projection(line,line,bool)"/></asyxml>*/
point P=projection(l1,l2)*M;
dot("$P$",P,2W);
draw(line(M,P),blue+dashed);

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

🔗geometry-fig020

Figure geometry 020 Generated with Asymptote

Show geometry/fig0200.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Point | #Line | #Parallel

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);

/*<asyxml><view file="modules/geometry.asy" type="point[]" signature="sameside(point,line,line)"/></asyxml>*/
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);

🔗geometry-fig021

Figure geometry 021 Generated with Asymptote

Show geometry/fig0210.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Line | #Markers

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;
/*<asyxml><view file="modules/geometry.asy" type="void" signature="markangle(picture,Label,int,real,real,line,line,arrowbar,pen,filltype,margin,marker)"/></asyxml>*/
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));

/*<asyxml><view file="modules/geometry.asy" type="real" signature="sharpdegrees(line,line)"/></asyxml>*/
markangle((string) sharpdegrees(l2,l1),
          radius=-1.5*markangleradius(),
          reverse(l2),l1,Arrow,red);

🔗geometry-fig022

Figure geometry 022 Generated with Asymptote

Show geometry/fig0220.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Line | #Markers | #Intersection

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)));
/*<asyxml><view file="modules/geometry.asy" type="line" signature="bisector(line,line,real,bool)"/></asyxml>*/
line bis=bisector(l1,l2);
draw(bis);

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

/*<asyxml><view file="modules/geometry.asy" type="void" signature="markangle(picture,Label,int,real,real,line,line,arrowbar,pen,filltype,margin,marker)"/></asyxml>*/
markangle(2, l1, l2, StickIntervalMarker(2,2,true));
markangle(2, reverse(l2), l1, radius=1.25*markangleradius(), StickIntervalMarker(2,1,true));

/*<asyxml><view file="modules/geometry.asy" type="bool" signature="concurrent(...line[])"/></asyxml>*/
if (concurrent(bis,l1,l2,Bis)) label("Concurrent",(3,3), dir(135));

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

🔗geometry-fig023

Figure geometry 023 Generated with Asymptote

Show geometry/fig0230.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Line | #Intersection

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);

/*<asyxml><view file="modules/geometry.asy" type="line" signature="complementary(explicit line)"/></asyxml>*/
draw("Complementary of $(AB]$", complementary(l2), dotted+roundcap);

point p=intersectionpoint(l1,l2);

/*<asyxml><view file="modules/geometry.asy" type="bool" signature="defined(pair)"/></asyxml>*/
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);

🔗geometry-fig024

Figure geometry 024 Generated with Asymptote

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-fig025

Figure geometry 025 Generated with Asymptote

Show geometry/fig0250.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Segment | #Perpendicular

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)));

/*<asyxml><view file="modules/geometry.asy" type="line" signature="bisector(segment,real)"/></asyxml>*/
line bis=bisector((segment) l1);
draw(bis,red);

/*<asyxml><view file="modules/geometry.asy" type="void" signature="show(picture,line,pen)"/></asyxml>*/
show(bis,grey);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="point(line,real)"/></asyxml>*/
dot(point(bis,1.5));

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

🔗geometry-fig026

Figure geometry 026 Generated with Asymptote

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'

🔗geometry-fig027

Figure geometry 027 Generated with Asymptote

Show geometry/fig0270.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Circle | #Ellipse | #Path

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;
/*<asyxml><view file="modules/geometry.asy" type="" signature="struct circle"/></asyxml>*/
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'
/*<asyxml><view file="modules/geometry.asy" type="path" signature="*(coordsys,path)"/></asyxml>*/
draw(currentcoordsys*Cp, red+blue);

🔗geometry-fig028

Figure geometry 028 Generated with Asymptote

Show geometry/fig0280.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Point | #Clip | #Circle

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));

/*<asyxml><view file="modules/geometry.asy" type="circle" signature="circle(point,point,point)"/></asyxml>*/
circle cc=circle(A,B,C);
draw(cc, blue);
dot(cc.C, blue);

/*<asyxml><view file="modules/geometry.asy" type="circle" signature="incircle(point,point,point)"/></asyxml>*/
circle ic=incircle(A,B,C);
draw(ic, red);
dot(ic.C, red);


/*<asyxml><view file="modules/geometry.asy" type="circle" signature="excircle(point,point,point)"/></asyxml>*/
circle ec=excircle(A,B,C);
/*<asyxml><view file="modules/geometry.asy" type="void" signature="clipdraw(picture,Label,path,align,pen,arrowbar,arrowbar,real,real,Label,marker)"/></asyxml>*/
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)));

🔗geometry-fig029

Figure geometry 029 Generated with Asymptote

Show geometry/fig0290.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Transform/scale/shift/rotate | #Ellipse | #Circle

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);

/*<asyxml><view file="modules/geometry.asy" type="ellipse" signature="*(transform,circle)"/></asyxml>*/
ellipse el=xscale(2)*C;
draw(el,blue,Arrow);

// /*<asyxml><view file="modules/geometry.asy" type="transform" signature="xscale(real,point)"/></asyxml>*/
ellipse el=xscale(2,A)*C;
draw(el,red,Arrow);

🔗geometry-fig030

Figure geometry 030 Generated with Asymptote

Show geometry/fig0300.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Transform/scale/shift/rotate | #Ellipse | #Circle

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);

/*<asyxml><view file="modules/geometry.asy" type="ellipse" signature="*(transform,circle)"/></asyxml>*/
draw(scale(0.5)*C,red,Arrow);

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

/*<asyxml><view file="modules/geometry.asy" type="circle" signature="/(explicit circle,real)"/></asyxml>*/
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);

🔗geometry-fig031

Figure geometry 031 Generated with Asymptote

Show geometry/fig0310.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Transform/scale/shift/rotate | #Ellipse | #Circle

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);

/*<asyxml><view file="modules/geometry.asy" type="ellipse" signature="*(transform,ellipse)"/></asyxml>*/
draw(scale(0.5)*el,red,Arrow);

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

/*<asyxml><view file="modules/geometry.asy" type="ellipse" signature="/(ellipse,real)"/></asyxml>*/
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);

🔗geometry-fig032

Figure geometry 032 Generated with Asymptote

Show geometry/fig0320.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Parabola

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);

/*<asyxml><view file="modules/geometry.asy" type="parabola" signature="parabola(point,line)"/></asyxml>*/
parabola p=parabola(F,l);
draw(p,linewidth(3mm));

/*<asyxml><view file="modules/geometry.asy" type="parabola" signature="parabola(point,point)"/></asyxml>*/
draw(parabola(p.F,p.V),2mm+red);

/*<asyxml><view file="modules/geometry.asy" type="parabola" signature="parabola(point,real,real)"/></asyxml>*/
draw(parabola(p.F,p.a,p.angle),1mm+green);

🔗geometry-fig033

Figure geometry 033 Generated with Asymptote

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

Figure geometry 034 Generated with Asymptote

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-fig035

Figure geometry 035 Generated with Asymptote

Show geometry/fig0350.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Circle | #Line | #Intersection

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);

/*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(line,circle)"/></asyxml>*/
point[] inter=intersectionpoints(l,c);
dot("$M$", inter[0], 2S, red);
dot("$N$", inter[1], 2N+0.5W, red);

🔗geometry-fig036

Figure geometry 036 Generated with Asymptote

Show geometry/fig0360.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Ellipse | #Intersection

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);

/*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(line,ellipse)"/></asyxml>*/
point[] inter=intersectionpoints(l,el);
dot("$M$", inter[0], 4N+2W, red);
dot("$N$", inter[1], 2S+0.5E, red);

🔗geometry-fig037

Figure geometry 037 Generated with Asymptote

Show geometry/fig0370.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Parabola | #Intersection

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);

/*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(line,parabola)"/></asyxml>*/
point[] inter=intersectionpoints(l,p);
dot("$M$", inter[0], 2N+E, red);
dot("$N$", inter[1], S+2E, red);

🔗geometry-fig038

Figure geometry 038 Generated with Asymptote

Show geometry/fig0380.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Intersection | #Hyperbola

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);

/*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(line,hyperbola)"/></asyxml>*/
point[] inter=intersectionpoints(l,h);
dot("$M$", inter[0], 2N+E, red);
dot("$N$", inter[1], 2S+E, red);

🔗geometry-fig039

Figure geometry 039 Generated with Asymptote

Show geometry/fig0390.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Intersection | #Circle

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;

/*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(line,circle)"/></asyxml>*/
dot(intersectionpoints(l,c),red);
dot(intersectionpoints(ll,c),red);

🔗geometry-fig040

Figure geometry 040 Generated with Asymptote

Show geometry/fig0400.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Intersection | #Ellipse

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;

/*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(line,ellipse)"/></asyxml>*/
dot(intersectionpoints(l,el),red);
dot(intersectionpoints(ll,el),red);

🔗geometry-fig041

Figure geometry 041 Generated with Asymptote

Show geometry/fig0410.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Intersection | #Parabola

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;

/*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(line,parabola)"/></asyxml>*/
dot(intersectionpoints(l,p), red);
dot(intersectionpoints(ll,p), red);

🔗geometry-fig042

Figure geometry 042 Generated with Asymptote

Show geometry/fig0420.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Intersection | #Circle

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);

/*<asyxml><view file="modules/geometry.asy" type="line" signature="radicalline(circle,circle)"/></asyxml>*/
draw(radicalline(c1,c2));
/*<asyxml><view file="modules/geometry.asy" type="point" signature="radicalcenter(circle,circle)"/></asyxml>*/
dot(radicalcenter(c1,c2));

dotfactor*=2;

/*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(circle,circle)"/></asyxml>*/
point[] inter=intersectionpoints(c1,c2);
dot("$M$", inter[0], 2SW, red);
dot("$N$", inter[1], 2NE, red);

🔗geometry-fig043

Figure geometry 043 Generated with Asymptote

Show geometry/fig0430.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Intersection | #Ellipse

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;

/*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(ellipse,ellipse)"/></asyxml>*/
point[] inter=intersectionpoints(el1,el2);
dot(inter);

🔗geometry-fig044

Figure geometry 044 Generated with Asymptote

Show geometry/fig0440.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Intersection | #Circle | #Tangent

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);

/*<asyxml><view file="modules/geometry.asy" type="line" signature="tangent(circle,point)"/></asyxml>*/
draw(tangent(c1,inter[0]), grey);
draw(tangent(c2,inter[0]), grey);

/*<asyxml><view file="modules/geometry.asy" type="line" signature="tangent(circle,abscissa)"/></asyxml>*/
draw(tangent(c2,angabscissa(135)), grey);

🔗geometry-fig045

Figure geometry 045 Generated with Asymptote

Show geometry/fig0450.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Intersection | #Circle | #Point | #Perpendicular

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);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="curpoint(line,real)"/></asyxml>*/
point T=curpoint(s,r/(r-R)*abs(c2));
dot(T);
/*<asyxml><view file="modules/geometry.asy" type="line" signature="tangents(circle,point)"/></asyxml>*/
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) {
    /*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(line,circle)"/></asyxml>*/
    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);

🔗geometry-fig046

Figure geometry 046 Generated with Asymptote

Show geometry/fig0460.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Intersection | #Ellipse | #Abscissa | #Point | #Tangent

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);

/*<asyxml><view file="modules/geometry.asy" type="line[]" signature="tangents(ellipse,point)"/></asyxml>*/
draw(tangents(el1,inter[0]), grey);
draw(tangents(el2,inter[0]), grey);

/*<asyxml><view file="modules/geometry.asy" type="line" signature="tangent(ellipse,abscissa)"/></asyxml>*/
draw(tangent(el2,angabscissa(90)), grey);

🔗geometry-fig047

Figure geometry 047 Generated with Asymptote

Show geometry/fig0470.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Intersection | #Parabola | #Abscissa | #Point | #Tangent

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));
/*<asyxml><view file="modules/geometry.asy" type="line" signature="tangent(parabola,abscissa)"/></asyxml>*/
draw(tangent(p,x), 0.8*red);

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

/*<asyxml><view file="modules/geometry.asy" type="line[]" signature="tangents(parabola,point)"/></asyxml>*/
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);

🔗geometry-fig048

Figure geometry 048 Generated with Asymptote

Show geometry/fig0480.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Intersection | #Hyperbola | #Abscissa | #Point | #Tangent

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));

/*<asyxml><view file="modules/geometry.asy" type="line" signature="tangent(hyperbola,abscissa)"/></asyxml>*/
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);

🔗geometry-fig049

Figure geometry 049 Generated with Asymptote

Show geometry/fig0490.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Intersection | #Hyperbola | #Point | #Tangent

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) {
    /*<asyxml><view file="modules/geometry.asy" type="line[]" signature="tangents(hyperbola,point)"/></asyxml>*/
    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);

🔗geometry-fig050

Figure geometry 050 Generated with Asymptote

Show geometry/fig0500.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Intersection | #Circle | #Tangent | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="line[]" signature="tangents(circle,point)"/></asyxml>*/
line[] tgt=tangents(c1,B);
draw(tgt,red);
/*<asyxml><view file="modules/geometry.asy" type="circle" signature="circle(point,point)"/></asyxml>*/
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);
}

🔗geometry-fig051

Figure geometry 051 Generated with Asymptote

Show geometry/fig0510.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Intersection | #Circle | #Tangent | #Ellipse | #Point

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);
  }

}

🔗geometry-fig052

Figure geometry 052 Generated with Asymptote

Show geometry/fig0520.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Intersection | #Circle | #Tangent | #Ellipse | #Point

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);
  }
}

🔗geometry-fig053

Figure geometry 053 Generated with Asymptote

Show geometry/fig0530.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Circle | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="circle" signature="circle(point,point,point)"/></asyxml>*/
circle c1=circle(A,B,C);
dot("$\Omega$",c1.C,N);
draw(c1);

🔗geometry-fig054

Figure geometry 054 Generated with Asymptote

Show geometry/fig0540.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Ellipse | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="ellipse" signature="ellipse(point,point,point,point,point)"/></asyxml>*/
ellipse el=ellipse(A,B,C,D,F);
draw(el);

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

/*<asyxml><view file="modules/geometry.asy" type="coordsys" signature="canonicalcartesiansystem(ellipse)"/></asyxml>*/
coordsys R=canonicalcartesiansystem(el);
show("$C$", "$\vec{u}$", "$\vec{v}$", R, xpen=blue);

🔗geometry-fig055

Figure geometry 055 Generated with Asymptote

Show geometry/fig0550.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Coords system | #Parabola | #Point

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));
/*<asyxml><view file="modules/geometry.asy" type="parabola" signature="parabola(point,point,point,line)"/></asyxml>*/
parabola p=parabola(A,B,C,l);
draw(p,blue);
draw(p.D,blue);

🔗geometry-fig056

Figure geometry 056 Generated with Asymptote

Show geometry/fig0560.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Line | #Abscissa | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="relpoint(line,real)"/></asyxml>*/
point P=relpoint(l, 1);
dot("relpoint(l, 1)", P, 2E,linewidth(2mm));
/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="relabscissa(line,point)"/></asyxml>*/
dot(point(l,relabscissa(l,P)), red);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="curpoint(line,real)"/></asyxml>*/
point P=curpoint(l, 1);
dot("curpoint(l, 1)", P, SE, blue+2mm);
/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="curabscissa(line,point)"/></asyxml>*/
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);

🔗geometry-fig057

Figure geometry 057 Generated with Asymptote

Show geometry/fig0570.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Distance | #Circle | #Abscissa | #Point

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);
/*<asyxml><view file="modules/geometry.asy" type="void" signature="distance(picture pic,Label,point,point,bool,real,pen,pen,arrow)"/></asyxml>*/
distance("$R=2$",A,point(C,0),0);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="relpoint(explicit circle,real)"/></asyxml>*/
dot("relpoint(C, 0)",relpoint(C,0),E);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="point(circle,abscissa)"/></asyxml>*/
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);

🔗geometry-fig058

Figure geometry 058 Generated with Asymptote

Show geometry/fig0580.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Ellipse | #Abscissa | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="relpoint(explicit ellipse,real)"/></asyxml>*/
dot("relpoint(el, 0)",relpoint(el,0),E);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="point(ellipse,abscissa)"/></asyxml>*/
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);

🔗geometry-fig059

Figure geometry 059 Generated with Asymptote

Show geometry/fig0590.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Parabola | #Abscissa | #Point

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.*/

/*<asyxml><view file="modules/geometry.asy" type="point" signature="relpoint(explicit parabola,real)"/></asyxml>*/
dot("relpoint(p, 0)",relpoint(p,0),SE);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="point(parabola,abscissa)"/></asyxml>*/
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);

🔗geometry-fig060

Figure geometry 060 Generated with Asymptote

Show geometry/fig0600.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Circle | #Abscissa | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="pair" signature="curpoint(explicit circle,real)"/></asyxml>*/
dot("curpoint(C, pi/2)", curpoint(C,pi/2),NE);

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

/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="curabscissa(real)"/></asyxml>*/
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);

🔗geometry-fig061

Figure geometry 061 Generated with Asymptote

Show geometry/fig0610.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Ellipse | #Abscissa | #Point

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);


/*<asyxml><view file="modules/geometry.asy" type="pair" signature="curpoint(explicit ellipse,real)"/></asyxml>*/
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));

/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="curabscissa(real)"/></asyxml>*/
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);

🔗geometry-fig062

Figure geometry 062 Generated with Asymptote

Show geometry/fig0620.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Parabola | #Abscissa | #Point

import geometry;
size(10cm);

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

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

draw(p);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="curpoint(explicit parabola,real)"/></asyxml>*/
dot("curpoint(p, 0)",curpoint(p,0),SE);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="point(parabola,abscissa)"/></asyxml>*/
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);

🔗geometry-fig063

Figure geometry 063 Generated with Asymptote

Show geometry/fig0630.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Circle | #Abscissa | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="angpoint(explicit circle,real)"/></asyxml>*/
dot("angpoint(C, 90)", angpoint(C,90),NW);

/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="angabscissa(real,polarconicroutine)"/></asyxml>*/
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);

🔗geometry-fig064

Figure geometry 064 Generated with Asymptote

Show geometry/fig0640.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Ellipse | #Abscissa | #Point

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);


/*<asyxml><view file="modules/geometry.asy" type="point" signature="angpoint(explicit ellipse,real,polarconicroutine)"/></asyxml>*/
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);


/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="angabscissa(real,polarconicroutine)"/></asyxml>*/
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);

🔗geometry-fig065

Figure geometry 065 Generated with Asymptote

Show geometry/fig0650.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Ellipse | #Abscissa | #Point

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;//
/////////////////////////////////////

/*<asyxml><view file="modules/geometry.asy" type="point" signature="angpoint(explicit ellipse,real,polarconicroutine)"/></asyxml>*/
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);


/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="angabscissa(real,polarconicroutine)"/></asyxml>*/
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);

🔗geometry-fig066

Figure geometry 066 Generated with Asymptote

Show geometry/fig0660.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Abscissa | #Parabola | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="angpoint(explicit parabola,real)"/></asyxml>*/
dot("angpoint(p, 180)",angpoint(p,180),SE+E);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="point(parabola,abscissa)"/></asyxml>*/
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);

🔗geometry-fig067

Figure geometry 067 Generated with Asymptote

Show geometry/fig0670.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Abscissa | #Parabola | #Point | #Arc

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);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="angpoint(explicit hyperbola,real,polarconicroutine)"/></asyxml>*/
dot(rotate(70)*"angpoint(h, 180)",angpoint(h,180),E);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="point(hyperbola,abscissa)"/></asyxml>*/
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);

/*<asyxml><view file="modules/geometry.asy" type="path" signature="arcfromfocus(conic,real,real,int,bool)"/></asyxml>*/
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);

🔗geometry-fig068

Figure geometry 068 Generated with Asymptote

Show geometry/fig0680.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Abscissa | #Hyperbola | #Point | #Arc

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);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="angpoint(explicit hyperbola,real,polarconicroutine)"/></asyxml>*/
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);

🔗geometry-fig069

Figure geometry 069 Generated with Asymptote

Show geometry/fig0690.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Abscissa | #Circle | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="point(explicit circle,explicit real)"/></asyxml>*/
dot("point(C, 15)", point(C,15),2E,3mm+blue);

/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="nodabscissa(real)"/></asyxml>*/
dot("point(C, 40)",
    point(C,nodabscissa(40)),
    2W,3mm+blue);
// point(C,nodabscissa(40)) can be replaced by point(C,40)

/*<asyxml><view file="modules/geometry.asy" type="int" signature="circlenodesnumber(real)"/></asyxml>*/
dot("point(C, 3*circlenodesnumber(R)/4)",
    point(C, 3*circlenodesnumber(R)/4), S, 3mm+blue);

dot((path)C, yellow);

write(length((path)C));

🔗geometry-fig070

Figure geometry 070 Generated with Asymptote

Show geometry/fig0700.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Abscissa | #Ellipse | #Point

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));

/*<asyxml><view file="modules/geometry.asy" type="point" signature="point(explicit ellipse,explicit real)"/></asyxml>*/
dot("point(el, 0)", point(el,0),N,3mm+blue);

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

/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="nodabscissa(real)"/></asyxml>*/
dot("point(el, 40)",
    point(el,nodabscissa(40)),
    2W,3mm+blue);
// point(el,nodabscissa(40)) can be replaced by point(el,40)

/*<asyxml><view file="modules/geometry.asy" type="int" signature="circlenodesnumber(real)"/></asyxml>*/
dot("point(el, 3*circlenodesnumber(max(a,b))/4)",
    point(el, 3*circlenodesnumber(max(a,b))/4), S, 3mm+blue);

dot((path)el, yellow);

🔗geometry-fig071

Figure geometry 071 Generated with Asymptote

Show geometry/fig0710.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Abscissa | #Parabola | #Point

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.*/

/*<asyxml><view file="modules/geometry.asy" type="point" signature="point(explicit parabola,explicit real)"/></asyxml>*/
dot("point(p, 0)", point(p,0),2E,3mm+blue);

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

/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="nodabscissa(real)"/></asyxml>*/
dot("point(p, 40)", point(p,nodabscissa(40)), 2W,3mm+blue);
// point(p,nodabscissa(40)) can be replaced by point(p,40)

/*<asyxml><view file="modules/geometry.asy" type="real[]" signature="bangles(picture,parabola)"/></asyxml>*/
real[] bg=bangles(p);

/*<asyxml><view file="modules/geometry.asy" type="int" signature="parabolanodesnumber(parabola,real,real)"/></asyxml>*/
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);

🔗geometry-fig072

Figure geometry 072 Generated with Asymptote

Show geometry/fig0720.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Abscissa | #Hyperbola | #Point

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.*/

/*<asyxml><view file="modules/geometry.asy" type="point" signature="point(explicit hyperbola,explicit real)"/></asyxml>*/
dot("point(h, 0)", point(h,0), 2W, 3mm+blue);

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

/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="nodabscissa(real)"/></asyxml>*/
dot("point(h, 40)", point(h,nodabscissa(40)), 2W,3mm+blue);
// point(h,nodabscissa(40)) can be replaced by point(h,40)

/*<asyxml><view file="modules/geometry.asy" type="real[]" signature="bangles(picture,hyperbola)"/></asyxml>*/
real[][] bg=bangles(h);

dot((path)h, yellow);

🔗geometry-fig073

Figure geometry 073 Generated with Asymptote

Show geometry/fig0730.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Abscissa | #Circle | #Point

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];

/*<asyxml><view file="modules/geometry.asy" type="void" signature="dot(picture,Label,explicit point,align,string,pen)"/></asyxml>*/
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;

/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="angabscissa(circle,point)"/></asyxml>*/
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;
/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="curabscissa(circle,point)"/></asyxml>*/
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;
/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="nodabscissa(circle,point)"/></asyxml>*/
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;
/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="relabscissa(circle,point)"/></asyxml>*/
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);

🔗geometry-fig074

Figure geometry 074 Generated with Asymptote

Show geometry/fig0740.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Abscissa | #Ellipse | #Point

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];

/*<asyxml><view file="modules/geometry.asy" type="void" signature="dot(picture,Label,explicit point,align,string,pen)"/></asyxml>*/
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;

/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="angabscissa(ellipse,point,polarconicroutine)"/></asyxml>*/
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;
/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="curabscissa(ellipse,point)"/></asyxml>*/
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;
/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="nodabscissa(ellipse,point)"/></asyxml>*/
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;
/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="relabscissa(ellipse,point)"/></asyxml>*/
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);

🔗geometry-fig075

Figure geometry 075 Generated with Asymptote

Show geometry/fig0750.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Abscissa | #Parabola | #Point/Dot | #Point

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];

/*<asyxml><view file="modules/geometry.asy" type="void" signature="dot(picture,Label,explicit point,align,string,pen)"/></asyxml>*/
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;

/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="angabscissa(parabola,point)"/></asyxml>*/
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;
// /*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="curabscissa(parabola,point)"/></asyxml>*/
// 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;
// /*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="nodabscissa(parabola,point)"/></asyxml>*/
// 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);

🔗geometry-fig076

Figure geometry 076 Generated with Asymptote

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);
}

🔗geometry-fig077

Figure geometry 077 Generated with Asymptote

Show geometry/fig0770.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Circle | #Ellipse

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);

/*<asyxml><view file="modules/geometry.asy" type="arc" signature="arc(ellipse,point,point,bool)"/></asyxml>*/
draw(arc(c,J[0],K[0]),1mm+0.8yellow);
draw(arc(c,K[0],J[1]),1mm+0.8red);
/*<asyxml><view file="modules/geometry.asy" type="arc" signature="arc(ellipse,abscissa,abscissa,bool)"/></asyxml>*/
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);

🔗geometry-fig078

Figure geometry 078 Generated with Asymptote

Show geometry/fig0780.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Circle | #Ellipse

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);

/*<asyxml><view file="modules/geometry.asy" type="arc" signature="arc(ellipse,point,point,bool)"/></asyxml>*/
draw(arc(el, J[0],K[0]), 1mm+0.8yellow);
draw(arc(el, K[0],J[1]), 1mm+0.8red);
/*<asyxml><view file="modules/geometry.asy" type="arc" signature="arc(ellipse,abscissa,abscissa,bool)"/></asyxml>*/
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));

🔗geometry-fig079

Figure geometry 079 Generated with Asymptote

Show geometry/fig0790.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Circle

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);

🔗geometry-fig080

Figure geometry 080 Generated with Asymptote

Show geometry/fig0800.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Circle | #Ellipse | #Transform/scale/shift/rotate

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;
/*<asyxml><view file="modules/geometry.asy" type="" signature="struct arc"/></asyxml>*/
arc C=arc(circle(A,R),45,180);/*<asyxml><view file="modules/geometry.asy" type="arc" signature="arc(ellipse,real,real,polarconicroutine,bool)"/></asyxml>*/
draw(C,Arrow);

/*<asyxml><view file="modules/geometry.asy" type="arc" signature="complementary(arc)"/></asyxml>*/
draw(complementary(C),dashed+grey,Arrow(position=Relative(0.75)));

/*<asyxml><view file="modules/geometry.asy" type="arc" signature="*(transform,explicit arc)"/></asyxml>*/
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;
/*<asyxml><view file="modules/geometry.asy" type="arc" signature="reverse(arc)"/></asyxml>*/
draw(reverse(Cp),0.8*yellow,Arrow);

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

🔗geometry-fig081

Figure geometry 081 Generated with Asymptote

Show geometry/fig0810.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Circle | #Ellipse | #Transform/scale/shift/rotate

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;
/*<asyxml><view file="modules/geometry.asy" type="" signature="struct arc"/></asyxml>*/
arc C=arc(ellipse(A,2R,R),45,180,fromCenter);
draw(C,Arrow);

/*<asyxml><view file="modules/geometry.asy" type="arc" signature="complementary(arc)"/></asyxml>*/
draw(complementary(C),dashed+grey,Arrow(position=Relative(0.75)));

/*<asyxml><view file="modules/geometry.asy" type="arc" signature="*(transform,explicit arc)"/></asyxml>*/
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;
/*<asyxml><view file="modules/geometry.asy" type="arc" signature="reverse(arc)"/></asyxml>*/
draw(reverse(Cp),0.8*yellow,Arrow);

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

🔗geometry-fig082

Figure geometry 082 Generated with Asymptote

Show geometry/fig0820.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Circle | #Transform/scale/shift/rotate | #Markers

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));

/*<asyxml><view file="modules/geometry.asy" type="void" signature="markarc(picture,Label,int,real,real,arc,arrowbar,pen,pen,margin,marker)"/></asyxml>*/
markarc(format("%0g",degrees(C)), C, Arrow);

/*<asyxml><view file="modules/geometry.asy" type="arc" signature="*(real, explicit arc)"/></asyxml>*/
draw(0.5*C,2mm+yellow);

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

🔗geometry-fig083

Figure geometry 083 Generated with Asymptote

Show geometry/fig0830.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Circle | #Transform/scale/shift/rotate | #Markers

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));

/*<asyxml><view file="modules/geometry.asy" type="void" signature="markarc(picture,Label,int,real,real,arc,arrowbar,pen,pen,margin,marker)"/></asyxml>*/
markarc(format("%0g",degrees(C)), C, radius=markangleradius(), Arrow);

/*<asyxml><view file="modules/geometry.asy" type="arc" signature="*(real, explicit arc)"/></asyxml>*/
draw(0.5*C, 2mm+yellow);

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

🔗geometry-fig084

Figure geometry 084 Generated with Asymptote

Show geometry/fig0840.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Ellipse | #Transform/scale/shift/rotate | #Markers

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));

/*<asyxml><view file="modules/geometry.asy" type="void" signature="markarc(picture,Label,int,real,real,arc,arrowbar,pen,pen,margin,marker)"/></asyxml>*/
markarc(format("%0g", degrees(a)), radius=-0.5*markangleradius(), a);

/*<asyxml><view file="modules/geometry.asy" type="arc" signature="*(real, explicit arc)"/></asyxml>*/
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);

🔗geometry-fig085

Figure geometry 085 Generated with Asymptote

Show geometry/fig0850.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Circle | #Transform/scale/shift/rotate | #Markers

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);

/*<asyxml><view file="modules/geometry.asy" type="void" signature="markarc(picture,Label,int,real,real,arc,arrowbar,pen,pen,margin,marker)"/></asyxml>*/
markarc(format("%0g", degrees(a)), radius=2.5*markangleradius(), a);

/*<asyxml><view file="modules/geometry.asy" type="arc" signature="*(real, explicit arc)"/></asyxml>*/
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);

🔗geometry-fig086

Figure geometry 086 Generated with Asymptote

Show geometry/fig0860.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Circle | #Abscissa | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="real" signature="degrees(arc)"/></asyxml>*/
write(degrees(C)); // Output is 225

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

/*<asyxml><view file="modules/geometry.asy" type="point" signature="relpoint(arc,real)"/></asyxml>*/
dot("relpoint(C, 0)", relpoint(C,0),E);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="point(arc,abscissa)"/></asyxml>*/
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);

🔗geometry-fig087

Figure geometry 087 Generated with Asymptote

Show geometry/fig0870.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Ellipse | #Abscissa | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="relpoint(arc,real)"/></asyxml>*/
dot("relpoint(C, 0)", relpoint(C,0),W);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="point(arc,abscissa)"/></asyxml>*/
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);

🔗geometry-fig088

Figure geometry 088 Generated with Asymptote

Show geometry/fig0880.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Circle | #Abscissa | #Point

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);
/*<asyxml><view file="modules/geometry.asy" type="void" signature="distance(picture pic,Label,point,point,bool,real,pen,pen,arrow)"/></asyxml>*/
distance("$R=2$",A,point(C.el,0),0);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="curpoint(arc,real)"/></asyxml>*/
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);

🔗geometry-fig089

Figure geometry 089 Generated with Asymptote

Show geometry/fig0890.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Ellipse | #Abscissa | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="curpoint(arc,real)"/></asyxml>*/
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);

🔗geometry-fig090

Figure geometry 090 Generated with Asymptote

Show geometry/fig0900.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Circle | #Abscissa | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="angpoint(arc,real)"/></asyxml>*/
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);

🔗geometry-fig091

Figure geometry 091 Generated with Asymptote

Show geometry/fig0910.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Ellipse | #Point | #Abscissa

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);

/*<asyxml><view file="modules/geometry.asy" type="arc" signature="reverse(arc)"/></asyxml>*/
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);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="angpoint(arc,real)"/></asyxml>*/
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);

🔗geometry-fig092

Figure geometry 092 Generated with Asymptote

Show geometry/fig0920.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Circle | #Abscissa | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="point(arc,real)"/></asyxml>*/
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);

/*<asyxml><view file="modules/geometry.asy" type="int" signature="arcnodesnumber(explicit arc)"/></asyxml>*/
dot(Label("point(C, 3*arcnodesnumber(R)/4)",UnFill),
    point(C, 3*arcnodesnumber(C)/4), 2E, 3mm+blue);

dot((path)C, yellow);

🔗geometry-fig093

Figure geometry 093 Generated with Asymptote

Show geometry/fig0930.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Ellipse | #Abscissa | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="point(arc,real)"/></asyxml>*/
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);

/*<asyxml><view file="modules/geometry.asy" type="int" signature="arcnodesnumber(explicit arc)"/></asyxml>*/
dot(Label("point(C, 3*arcnodesnumber(R)/4)",UnFill),
    point(C, 3*arcnodesnumber(C)/4), 2E, 3mm+blue);

dot((path)C, yellow);

🔗geometry-fig094

Figure geometry 094 Generated with Asymptote

Show geometry/fig0940.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Circle | #Abscissa | #Point

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;

/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="angabscissa(arc,point)"/></asyxml>*/
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;
/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="curabscissa(arc,point)"/></asyxml>*/
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;
/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="nodabscissa(arc,point)"/></asyxml>*/
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;
/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="relabscissa(arc,point)"/></asyxml>*/
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);

🔗geometry-fig095

Figure geometry 095 Generated with Asymptote

Show geometry/fig0950.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Ellipse | #Abscissa | #Point

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;

/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="angabscissa(arc,point)"/></asyxml>*/
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;
/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="curabscissa(arc,point)"/></asyxml>*/
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;
/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="nodabscissa(arc,point)"/></asyxml>*/
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;
/*<asyxml><view file="modules/geometry.asy" type="abscissa" signature="relabscissa(arc,point)"/></asyxml>*/
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);

🔗geometry-fig096

Figure geometry 096 Generated with Asymptote

Show geometry/fig0960.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Circle | #Line | #Abscissa | #Intersection | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="arc" signature="arc(explicit arc,point,point)"/></asyxml>*/
draw(arc(c,K[0],J[0]),2mm+0.8yellow);
draw(arc(c,J[1],K[0]),2mm+0.8red);
/*<asyxml><view file="modules/geometry.asy" type="arc" signature="arc(explicit arc,abscissa,abscissa)"/></asyxml>*/
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);

🔗geometry-fig097

Figure geometry 097 Generated with Asymptote

Show geometry/fig0970.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Ellipse | #Line | #Abscissa | #Intersection | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="arc" signature="arc(explicit arc,point,point)"/></asyxml>*/
draw(arc(c,J[0],K[0]),2mm+0.8yellow);
draw(arc(c,K[0],J[1]),2mm+0.8red);
/*<asyxml><view file="modules/geometry.asy" type="arc" signature="arc(explicit arc,abscissa,abscissa)"/></asyxml>*/
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);

🔗geometry-fig098

Figure geometry 098 Generated with Asymptote

Show geometry/fig0980.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Arrows/Bars | #Circle | #Abscissa

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));

/*<asyxml><view file="modules/geometry.asy" type="arc" signature="arc(explicit arc,abscissa,abscissa)"/></asyxml>*/
draw(arc(a,angabscissa(135),angabscissa(225)),1mm+red,ArcArrow(3mm),TrueMargin(0,0.5mm));

🔗geometry-fig099

Figure geometry 099 Generated with Asymptote

Show geometry/fig0990.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Arrows/Bars | #Ellipse | #Abscissa

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));

/*<asyxml><view file="modules/geometry.asy" type="arc" signature="arc(explicit arc,abscissa,abscissa)"/></asyxml>*/
draw(arc(a,angabscissa(135),angabscissa(225)),1mm+red,ArcArrow(3mm),TrueMargin(0,0.5mm));

🔗geometry-fig100

Figure geometry 100 Generated with Asymptote

Show geometry/fig1000.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Arrows/Bars | #Circle | #Abscissa | #Coords system

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);

/*<asyxml><view file="modules/geometry.asy" type="arc" signature="arccircle(point,point,point)"/></asyxml>*/
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);

🔗geometry-fig101

Figure geometry 101 Generated with Asymptote

Show geometry/fig1010.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Circle | #Intersection | #Line | #Coords system

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);

/*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(arc,arc)"/></asyxml>*/
point[] inter=intersectionpoints(a,b);
dot(inter);

/*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(line,arc)"/></asyxml>*/
point[] inter=intersectionpoints(l,a);
dot(inter);

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

🔗geometry-fig102

Figure geometry 102 Generated with Asymptote

Show geometry/fig1020.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Ellipse | #Intersection | #Line | #Coords system

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);

/*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(arc,arc)"/></asyxml>*/
point[] inter=intersectionpoints(a,b);
dot(inter);

/*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(line,arc)"/></asyxml>*/
point[] inter=intersectionpoints(l,a);
dot(inter);

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

🔗geometry-fig103

Figure geometry 103 Generated with Asymptote

Show geometry/fig1030.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Circle | #Intersection | #Line | #Coords system | #Tangent

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);

/*<asyxml><view file="modules/geometry.asy" type="line" signature="tangent(explicit arc,point)"/></asyxml>*/
draw(tangent(a,M), grey);
draw(tangent(b,M), grey);

/*<asyxml><view file="modules/geometry.asy" type="line" signature="tangent(explicit arc,abscissa)"/></asyxml>*/
draw(tangent(a,angabscissa(45)), grey);

🔗geometry-fig104

Figure geometry 104 Generated with Asymptote

Show geometry/fig1040.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Ellipse | #Intersection | #Line | #Coords system | #Tangent

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);

/*<asyxml><view file="modules/geometry.asy" type="line" signature="tangent(explicit arc,point)"/></asyxml>*/
draw(tangent(a,M), grey);
draw(tangent(b,M), grey);

/*<asyxml><view file="modules/geometry.asy" type="line" signature="tangent(explicit arc,abscissa)"/></asyxml>*/
draw(tangent(a,angabscissa(45)), grey);

🔗geometry-fig105

Figure geometry 105 Generated with Asymptote

Show geometry/fig1050.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Segment | #Intersection | #Line | #Markers | #Point

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);

/*<asyxml><view file="modules/geometry.asy" type="path" signature="compassmark(pair,pair,real,real)"/></asyxml>*/
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);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="point(line,real)"/></asyxml>*/
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);

🔗geometry-fig106

Figure geometry 106 Generated with Asymptote

Show geometry/fig1060.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Arc | #Point

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;
  /*<asyxml><view file="modules/geometry.asy" type="point" signature="arcsubtendedcenter(point,point,real)"/></asyxml>*/
  dot(arcsubtendedcenter(A,B,a),2mm+blue);
  
  point arccenter=arcsubtendedcenter(A,B,a/2);
  dot(arccenter,2mm+red);

  /*<asyxml><view file="modules/geometry.asy" type="arc" signature="arcsubtended(point,point,real)"/></asyxml>*/
  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);
 }

🔗geometry-fig107

Figure geometry 107 Generated with Asymptote

Show geometry/fig1070.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Mass | #Point/Dot | #Point

import geometry;
size(8cm,0);

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

/*<asyxml><view file="modules/geometry.asy" type="" signature="struct mass"/></asyxml>*/
mass A=mass((1,0),3);/*<asyxml><view file="modules/geometry.asy" type="mass" signature="mass(point,real)"/></asyxml>*/

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

/*<asyxml><view file="modules/geometry.asy" type="void" signature="dot(picture,Label,mass,align,string,pen)"/></asyxml>*/
dot("$\left(B;\sqrt{3}\right)$",B,N,format="");

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

/*<asyxml><view file="modules/geometry.asy" type="mass" signature="masscenter(... mass[])"/></asyxml>*/
dot("G",masscenter(A,B,mass(C)),S);

🔗geometry-fig108

Figure geometry 108 Generated with Asymptote

Show geometry/fig1080.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Triangle

import geometry;

size(10cm);

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

/*<asyxml><view file="modules/geometry.asy" type="triangle" signature="triangleabc(real,real,real,real,point)"/></asyxml>*/
triangle t=triangleabc(3,4,5);
/*<asyxml><view file="modules/geometry.asy" type="void" signature="show(picture,Label,Label,Label,Label,Label,Label,triangle,pen,filltype)"/></asyxml>*/
show(La="3", Lb="4", Lc="5",t);

🔗geometry-fig109

Figure geometry 109 Generated with Asymptote

Show geometry/fig1090.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Triangle | #Markers

import geometry;

size(10cm);

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

/*<asyxml><view file="modules/geometry.asy" type="triangle" signature="triangleAbc(real,real,real,real,point)"/></asyxml>*/
triangle t=triangleAbc(60,3,5,angle=90);
show(Lb="3", Lc="5",t);
markangle("$60^\circ$",t.B,t.A,t.C);

🔗geometry-fig110

Figure geometry 110 Generated with Asymptote

Show geometry/fig1100.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Triangle | #Markers | #Label | #Segment

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));
/*<asyxml><view file="modules/geometry.asy" type="void" signature="label(picture,Label,Label,Label,triangle,real,real,pen,filltype)"/></asyxml>*/
label(t, alignFactor=4);

/*<asyxml><view file="modules/geometry.asy" type="triangle" signature="anticomplementary(triangle)"/></asyxml>*/
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));

🔗geometry-fig111

Figure geometry 111 Generated with Asymptote

Show geometry/fig1110.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Triangle | #Circle | #Tangent | #Line | #Label | #Point

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));

/*<asyxml><view file="modules/geometry.asy" type="void" signature="drawline(picture,triangle,pen)"/></asyxml>*/
drawline(t, linewidth(bp));
/*<asyxml><view file="modules/geometry.asy" type="void" signature="label(picture,Label,Label,Label,triangle,real,real,pen,filltype)"/></asyxml>*/
label(t,alignFactor=4);

/*<asyxml><view file="modules/geometry.asy" type="circle" signature="circle(triangle)"/></asyxml>*/
circle cc=circle(t);
draw(cc, 0.8blue);
dot(cc.C, blue);
/*<asyxml><view file="modules/geometry.asy" type="triangle" signature="tangential(triangle)"/></asyxml>*/
triangle tgt=tangential(t);
draw(tgt, bp+0.8blue);
label("$A_1$", "$B_1$", "$C_1$", tgt, blue);

/*<asyxml><view file="modules/geometry.asy" type="circle" signature="incircle(triangle)"/></asyxml>*/
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);

/*<asyxml><view file="modules/geometry.asy" type="circle" signature="excircle(side,triangle)"/></asyxml>*/
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);

/*<asyxml><view file="modules/geometry.asy" type="triangle" signature="extouch(triangle)"/></asyxml>*/
triangle ext=extouch(t);
draw(ext, bp+0.8green);
label("$A_3$", "$B_3$", "$C_3$", ext, green);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="extouch(side)"/></asyxml>*/
dot(extouch(t.AB), 0.8*green);
dot(extouch(t.BC), 0.8*green);
dot(extouch(t.CA), 0.8*green);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="intouch(side)"/></asyxml>*/
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);

🔗geometry-fig112

Figure geometry 112 Generated with Asymptote

Show geometry/fig1120.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Triangle | #Line | #Label | #Point | #Markers

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);

/*<asyxml><view file="modules/geometry.asy" type="triangle" signature="symmedial(triangle)"/></asyxml>*/
triangle st=symmedial(t);
draw(st, bp+0.8green);
label("$A'$", "$B'$", "$C'$", st, alignAngle=45, 0.8green);

/*<asyxml><view file="modules/geometry.asy" type="line" signature="median(vertex)"/></asyxml>*/
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));

/*<asyxml><view file="modules/geometry.asy" type="line" signature="bisector(vertex,real)"/></asyxml>*/
line bA=bisector(t.VA);
draw(bA, grey);
/*<asyxml><view file="modules/geometry.asy" type="point" signature="bisectorpoint(side)"/></asyxml>*/
dot("$B_A$", bisectorpoint(t.BC));

/*<asyxml><view file="modules/geometry.asy" type="line" signature="symmedian(vertex)"/></asyxml>*/
line sA=symmedian(t.VA);
draw(sA, 0.8*green);

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

/*<asyxml><view file="modules/geometry.asy" type="point" signature="symmedian(triangle)"/></asyxml>*/
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));

🔗geometry-fig113

Figure geometry 113 Generated with Asymptote

Show geometry/fig1130.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Triangle | #Line | #Markers | #Transform/scale/shift/rotate | #Perpendicular

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);

🔗geometry-fig114

Figure geometry 114 Generated with Asymptote

Show geometry/fig1140.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Triangle | #Line | #Point | #Markers

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);

/*<asyxml><view file="modules/geometry.asy" type="point" signature="incenter(triangle)"/></asyxml>*/
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));

🔗geometry-fig115

Figure geometry 115 Generated with Asymptote

Show geometry/fig1150.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Triangle | #Line | #Point | #Intersection

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);
/*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(triangle,line,bool)"/></asyxml>*/
dot(intersectionpoints(t,l), 0.8*red);

circle C=2*circle(t);
draw(C, 0.8*blue);
/*<asyxml><view file="modules/geometry.asy" type="point[]" signature="intersectionpoints(triangle,conic,bool)"/></asyxml>*/
dot(intersectionpoints(t,C, true), 0.8*blue);

🔗geometry-fig116

Figure geometry 116 Generated with Asymptote

Show geometry/fig1160.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Triangle | #Line | #Point/Dot | #Distance | #Shipout | #Bbox

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));

🔗geometry-fig117

Figure geometry 117 Generated with Asymptote

Show geometry/fig1170.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 2D | Geometry.asy
Tags : #Geometry | #Inversion | #Shipout | #Bbox | #Circle | #Line

import geometry; size(15cm);

inversion inv=inversion(1,(-3.6,0));
path g1=inv*line((-1,0),(-1,1)),
g2=inv*line((1,0),(1,1));
fill(g1,0.91*yellow); 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)*orange);
  // draw(g,bp+0.8*orange); //draw(g,black);
}
shipout(bbox(5mm,Fill(rgb(0.95,0.95,0.7))));

0%