2007年6月8日星期五

Asymptote学习系列(2)

几个入门的例子
draw((0,0)--(100,100));
 
draw((0,0)--(100,0)--(100,100)--(0,100)--cycle);
 
size(101,101);
draw((0,0)--(1,0)--(1,1)--(0,1)--cycle);
 
size(0,3cm);
draw(unitsquare);
label("$A$",(0,0),SW);
label("$B$",(1,0),SE);
label("$C$",(1,1),NE);
label("$D$",(0,1),NW);
//S,W,E,N是标准的指南针方向
 
size(100,0);
draw((1,0){up}..{left}(0,1));
 
path unitcircle=E..N..W..S..cycle;
 
//The user can specify explicit control points between two nodes like this:
draw((0,0)..controls (0,100) and (100,100)..(100,0));
 
draw((100,0){curl 0}..(100,100)..{curl 0}(0,100));
 
draw((100,0)..tension 2 ..(100,100)..(0,100));
draw((100,0)..tension 2 and 1 ..(100,100)..(0,100));
draw((100,0)..tension atleast 1 ..(100,100)..(0,100));
 
draw((0,0){up}..(100,25){right}..(200,0){down});
 
draw((0,0){up}::(100,25){right}::(200,0){down});
 
size(0,100);
path unitcircle=E..N..W..S..cycle;
path g=scale(2)*unitcircle;
filldraw(unitcircle^^g,evenodd+yellow,black);
 
看看每一个的效果吧
 
 
--
一步一步教你从互联网赚钱 http://www.zqzn.com/index.asp?rid=key480769
投资理财 http://li-cai.blogspot.com/

没有评论: