Point.prototype=new Extra_Graphics();Point.prototype.constructor=Point;function Point(a,b){if(_COORDINATE_PRECISION!=0){this._x=parseFloat(new Number(a).toFixed(_COORDINATE_PRECISION));this._y=parseFloat(new Number(b).toFixed(_COORDINATE_PRECISION))}else{this._x=parseFloat(new Number(a));this._y=parseFloat(new Number(b))}this._w=5;this._h=5;this._filled=false;this._snap_type=_NO_SNAP}Point.prototype.draw=function(c){try{var a=_MAP_WRAPPER.convert_to_pixel(this._x,this._y,true);a=this.clip(a[0],a[1]);c.setStroke(this.get_stroke());c.setColor(this.get_color());c.setPrintable(this._printable);if(a!=null){if(this._filled){c.fillRect(a[0]-this._w*0.5,a[1]-this._h*0.5,this._w,this._h)}else{c.drawRect(a[0]-this._w*0.5,a[1]-this._h*0.5,this._w,this._h)}}}catch(b){throw"Point.draw(): "+b}};Point.prototype.snap_point=function(b,e){var d=false;var c=new Array(this._x-0.5*_SNAP_TOLERANCE,this._y-0.5*_SNAP_TOLERANCE);var a=new Array(this._x+0.5*_SNAP_TOLERANCE,this._y+0.5*_SNAP_TOLERANCE);if((b>c[0])&&(b<a[0])&&(e>c[1])&&(e<a[1])){d=new Array(this._x,this._x);return d}return false};Point.prototype.distance=function(a){return Math.sqrt(Math.pow(this._x-a._x,2)+Math.pow(this._y-a._y,2))};Point.prototype.clone=function(){return new Point(this._x,this._y)};Point.prototype.equals=function(a){return((this._x==a._x)&&(this._y==a._y))};Point.prototype.move=function(c,b){try{var a=parseFloat(new Number(this._x+=c));var f=parseFloat(new Number(this._y+=b));if(_COORDINATE_PRECISION!=0){this._x=parseFloat(new Number(a).toFixed(_COORDINATE_PRECISION));this._y=parseFloat(new Number(f).toFixed(_COORDINATE_PRECISION))}else{this._x=a;this._y=f}}catch(d){throw"Point.move: "+d}};Point.prototype.to_string=function(){return"Point: "+this._x+","+this._y};Point.prototype.clip=function(a,b){try{if(this.code(a,b)){return null}else{return new Array(a,b)}}catch(c){throw"Point.clip(): "+c}};Point.prototype.code=function(a,b){return(a<0)|(a>_MAP_WRAPPER._width)|(b<0)|(b>_MAP_WRAPPER._height)};
