19 Aug 2007

Asymptote using geometry.asy – fig0160

Figure 0016
(Compiled with Asymptote version 2.14svn-r5318)
    
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);
/* View the definition of struct line */
line l1=line(A,B);/* View the definition of line line(point,bool,point,bool) */

/* View the definition of void draw(picture,Label,line,bool,bool,align,pen,arrowbar,Label,marker) */
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));
}


Étiquettes : , , , ,