4、="position:absolute;left:'+x+';top:'+y+';height:'+h+';width:'+w+';font-size:1px;background-color:'+color+'">')}functionPlot(x,y){outPlot(x,y,1,1)if(Ox>=0
5、
6、Oy>=0){ShowLine(Ox,Oy,x-Ox,y-Oy)}Ox=xOy=y}functionShowLine(x,y,w,h){if(w<0){x+=ww=Math.abs(w)}if(h<0){y+=hh=Math.abs(h)}if(w<1)w=1if(h<1
7、)h=1outPlot(x,y,Math.round(w),Math.round(h))}functionLineTo(x,y){Line(xo,yo,x,y)}functionsign(n){if(n>0)return1if(n<0)return-1returnn}functionLine(x1,y1,x2,y2){x2=Math.round(x2)y2=Math.round(y2)xo=x2yo=y2y1=orgY(y1)y2=orgY(y2)varstr=""vari=0varx=x1vary=y1dx=Math.abs(x2-x1)dy=Math.abs(y2-y1)s1=sign
8、(x2-x1)s2=sign(y2-y1)if(dx==0
9、
10、dy==0){ShowLine(x1,y1,x2-x1,y2-y1)return}if(dx>dy){temp=dxdx=dydy=tempkey=1}elsekey=0e=2*dy-dxfor(i=0;i=0){if(key==1){x+=s1px+=s1}else{y+=s2py+=s2}e=e-2*dx}if(key==1)y+=s2elsex+=s1e=e+2*dy}}functionMoveTo(x,y){Ox=Oy=-1xo=Math.round(x
11、)yo=Math.round(y)}//圓functionCir(x,y,r){MoveTo(x+r,y)for(i=0;i<=360;i+=5){LineTo(r*Math.cos(i*rad)+x,r*Math.sin(i*rad)+y)}}//弧形functionArc(x,y,r,a1,a2){MoveTo(r*Math.cos(a1*rad)+x,r*Math.sin(a1*rad)+y)for(i=a1;i<=a2;i++){LineTo(r*Math.cos(i*rad)+x,r*Math.sin(i*rad)+y)}}//扇形functionPei(x,y,r,a1,a2)
12、{MoveTo(x,y)for(vari=a1;i<=a2;i++){LineTo(r*Math.cos(i*rad)+x,r*Math.sin(i*rad)+y)}LineTo(x,y)}//彈出扇形functionPopPei(x,y,r,a1,a2){dx=r*Math.cos((a1+(a2-a1)/2)*rad)/10dy=r*Math.sin((a1+(a2-a1)/2)*rad)/10x+=dxy+=dyMoveTo(x,y)for(vari=a1;i<=a2;i++){LineTo(r*Math.cos(i*rad)+x,r*Math.sin(i*rad)+y)}LineT
13、o(x,y)}//矩形functionRect(x,y,w,h){MoveTo(x,y)LineTo(x+w,y)LineTo(x+w,y+h)LineTo(x,y+h)LineTo(x,y)}//準(zhǔn)星functionzhunxing(x,y){varox=xovaroy=yovaroColor=colorcolor="#000000"Line(x-5,y,x+6,y)Line(x,y-6,x,y+5)print('