PIPRIME.FR BLOG

Live fully to honor life

Tag Markers -- Asymptote Gallery

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

🔗solids-fig009

Figure solids 009 Generated with Asymptote

Show solids/fig0090.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 3D | Solids.asy
Tags : #Solid | #Arc (3D) | #Markers | #Revolution | #Surface | #Sphere

size(8cm, 0);
import solids;
import graph3;

//Draw 3D right angle (MA, MB)
void drawrightangle(picture pic=currentpicture,
                    triple M, triple A, triple B,
                    real radius=0,
                    pen p=currentpen,
                    pen fillpen=nullpen,
                    projection P=currentprojection)
{
  p=linejoin(0)+linecap(0)+p;
  if (radius==0) radius=arrowfactor*sqrt(2);
  transform3 T=shift(-M);
  triple OA=radius/sqrt(2)*unit(T*A),
    OB=radius/sqrt(2)*unit(T*B),
    OC=OA+OB;
  path3 tp=OA--OC--OB;
  picture tpic;
  draw(tpic, tp, p=p);
  if (fillpen!=nullpen) draw(tpic, surface(O--tp--cycle), fillpen);
  add(pic, tpic, M);
}

currentprojection=orthographic(10, 15, 3);

real r=10, h=6; // r=sphere radius; h=altitude section
triple Op=(0, 0, h);

limits((0, 0, 0), 1.1*(r, r, r));
axes3("x", "y", "z");

real rs=sqrt(r^2-h^2); // section radius
real ch=180*acos(h/r)/pi;
path3 arcD=Arc(O, r, 180, 0, ch, 0, Y, 50);

revolution sphereD=revolution(O, arcD, Z);
draw(surface(sphereD), opacity(0.5)+lightblue);
draw(shift(0, 0, h)*scale3(rs)*surface(unitcircle3), opacity(0.5));

path3 arcU=Arc(O, r, ch, 0, 0, 0, Y, 10);
revolution sphereU=revolution(O, arcU, Z);
draw(surface(sphereU), opacity(0.33)+lightgrey);

// right triangle OO'A
triple A=rotate(100, Z)*(rs, 0, h);
dot("$O$", O, NW);
dot("$O'$", Op, W);
dot("$A$", A, N);
draw(A--O--Op--A);
drawrightangle(Op, O, A);

if(!is3D())
  shipout(format="pdf", bbox(Fill(paleyellow)));

🔗solids-fig012

Figure solids 012 Generated with Asymptote

Show solids/fig0120.asy on Github.
Generated with Asymptote 3.00-0.
Categories : Examples 3D | Solids.asy
Tags : #Solid | #Intersection | #Revolution | #Wire frame | #Markers

import solids;

size(10cm, 0);
currentprojection=orthographic(-50, 100, 40);

//Draw right angle (MA, MB) in 3D
void drawrightangle(picture pic=currentpicture,
                    triple M, triple A, triple B,
                    real radius=0,
                    pen p=currentpen,
                    pen fillpen=nullpen,
                    projection P=currentprojection)
{
  p=linejoin(0)+linecap(0)+p;
  if (radius==0) radius=arrowfactor*sqrt(2);
  transform3 T=shift(-M);
  triple OA=radius/sqrt(2)*unit(T*A),
    OB=radius/sqrt(2)*unit(T*B),
    OC=OA+OB;
  path3 _p=OA--OC--OB;
  picture pic_;
    draw(pic_, _p, p=p);
    if (fillpen!=nullpen) draw(pic_, surface(O--_p--cycle), fillpen);
  add(pic, pic_, M);
}

// *...............Construction starts here................*

real r=1, h=.75;
real gle=60;
real gleA=20;
transform3 tR=rotate(gle, Z);
transform3 tT=shift((0, 0, -h));

triple H=(0, 0, h),//the label is O in the picture.
  A=rotate(gleA, Z)*(0, r, h),
  F=tR*A,
  B=tR*F,
  D=tT*A,
  C=tT*B,
  Ei=intersectionpoint(H--F, A--B);

revolution r=cylinder(O, r, h, Z);
// draw(surface(r));
draw(r);

draw(O--H, dashed);
draw(O--D--C--cycle^^O--H^^B--C, dashed);

drawrightangle(Ei, H, B, fillpen=black);

dot(Label("$O'$", align=invert(NE+E, O)), O);
// layer();
draw(surface(A--B--C--D--cycle), lightgrey+opacity(.5));

dot(Label("$A$", align=NW), A);
dot(Label("$B$", align=N), B);
dot(Label("$C$", align=S), C);
dot(Label("$D$", align=NW), D);
dot(Label("$E$", align=S), Ei);
dot(Label("$F$", align=S), F);
dot(Label("$O$", align=N), H);

draw(H--B--F--A--cycle^^H--F^^A--B^^A--D);

0%