function cRectangle(p1,p2){if((!p1)||(!$.isArray(p1))){p1=[0,0];} if((!p2)||(!$.isArray(p2))){p2=[0,0];} if(!p1[0]){p1[0]=0;} if(!p1[1]){p1[1]=0;} if(!p2[0]){p2[0]=0;} if(!p2[1]){p2[1]=0;} p1[0]=parseFloat(p1[0]);p1[1]=parseFloat(p1[1]);p2[0]=parseFloat(p2[0]);p2[1]=parseFloat(p2[1]);if(isNaN(p1[0])){p1[0]=0;} if(isNaN(p1[1])){p1[1]=0;} if(isNaN(p2[0])){p2[0]=0;} if(isNaN(p2[1])){p2[1]=0;} this._p1=p1;this._p2=p2;this._p1x=p1[0];this._p1y=p1[1];this._p2x=p2[0];this._p2y=p2[1];this._c=null;this._e=null;} cRectangle.prototype.points=function(){return{'p1':this._p1,'p2':this._p2};} cRectangle.prototype.p1p2=function(){return[this._p1,this._p2];} cRectangle.prototype.p1=function(){return this._p1;} cRectangle.prototype.p2=function(){return this._p2;} cRectangle.prototype.sp1=function(){return'('+this._p1x+', '+this._p1y+')';} cRectangle.prototype.sp2=function(){return'('+this._p2x+', '+this._p2y+')';} cRectangle.prototype.minX=function(){return(this._p1x