class TPoint { var x,y:Number; function TPoint(x1,y1:Number){ x = x1; y = y1; } public static function dist(a,b:TPoint){ return(Math.sqrt( Math.pow(a.x-b.x,2)+Math.pow(a.y-b.y,2) )); } //判断点a是否在以bc为对角线的矩形内 public function isinrec(b,c:TPoint){ var i:Number; if ( ( (this.x-b.x)*(this.x-c.x)<0 ) && ( (this.y-b.y)*(this.y-c.y)<0 ) ){ return(true); }else{ return(false); } } public function output(){ trace(x+" , "+y); } public function equalto(a:TPoint){ if ((x - a.x== 0) && (y - a.y == 0)){ return true; }else{ return false; } } }