//已知中心点坐标,水平半径rx,垂直半径ry,绘制椭圆
MovieClip.prototype.drawOval=function(x,y,rx,ry){
this.moveTo(x+rx,y);
this.curveTo(rx+x,0.4142*ry+y,0.7071*rx+x,0.7071*ry+y);
this.curveTo(0.4142*rx+x,ry+y,x,ry+y);
this.curveTo(-0.4142*rx+x,ry+y,-0.7071*rx+x,0.7071*ry+y);
this.curveTo(-rx+x,0.4142*ry+y,-rx+x,y);
this.curveTo(-rx+x,-0.4142*ry+y,-0.7071*rx+x,-0.7071*ry+y);
this.curveTo(-0.4142*rx+x,-ry+y,x,-ry+y);
this.curveTo(0.4142*rx+x,-ry+y,0.7071*rx+x,-0.7071*ry+y);
this.curveTo(rx+x,-0.4142*ry+y,rx+x,y);
};
//已知坐标,半径,绘制一个圆
MovieClip.prototype.drawCircle=function(x,y,r){
this.drawOval(x,y,r,r);
};
MovieClip.prototype.drawOval=function(x,y,rx,ry){
this.moveTo(x+rx,y);
this.curveTo(rx+x,0.4142*ry+y,0.7071*rx+x,0.7071*ry+y);
this.curveTo(0.4142*rx+x,ry+y,x,ry+y);
this.curveTo(-0.4142*rx+x,ry+y,-0.7071*rx+x,0.7071*ry+y);
this.curveTo(-rx+x,0.4142*ry+y,-rx+x,y);
this.curveTo(-rx+x,-0.4142*ry+y,-0.7071*rx+x,-0.7071*ry+y);
this.curveTo(-0.4142*rx+x,-ry+y,x,-ry+y);
this.curveTo(0.4142*rx+x,-ry+y,0.7071*rx+x,-0.7071*ry+y);
this.curveTo(rx+x,-0.4142*ry+y,rx+x,y);
};
//已知坐标,半径,绘制一个圆
MovieClip.prototype.drawCircle=function(x,y,r){
this.drawOval(x,y,r,r);
};
回复Comments
作者:
{commentrecontent}