function Point(xPos,yPos){this.x=xPos;this.y=yPos;};Point.prototype.set=function(xPos,yPos){this.x=xPos;this.y=yPos;};Point.prototype.rotate=function(origin,angle){var rdAngle=angle*Math.PI/180;var reltvX=this.x-origin.x;var reltvY=this.y-origin.y;var roteX=reltvX*Math.cos(rdAngle)-reltvY*Math.sin(rdAngle);var roteY=reltvX*Math.sin(rdAngle)+reltvY*Math.cos(rdAngle);this.x=origin.x+roteX;this.y=origin.y+roteY;};Point.distance=function(pos1,pos2){var reltvX=pos1.x-pos2.x;var reltvY=pos1.y-pos2.y;return Math.sqrt(reltvX*reltvX+reltvY*reltvY);};Point.sqdist=function(pos1,pos2){var reltvX=pos1.x-pos2.x;var reltvY=pos1.y-pos2.y;return reltvX*reltvX+reltvY*reltvY;};Point.angle=function(pos1,pos2){var reltvX=pos1.x-pos2.x;var reltvY=pos1.y-pos2.y;return Math.atan2(reltvY,reltvX)*180/Math.PI;};Point.prototype.toString=function(){return"("+this.x+", "+this.y+")";};Point.prototype.equals=function(X){if(!X)return false;return this.x==X.x&&this.y==X.y};Point.prototype.approxEquals=function(X){if(!X)return false;return approxCompare(this.x,X.x)&&approxCompare(this.y,X.y)};function Size(w,h){this.width=w;this.height=h};Size.prototype.set=function(w,h){this.width=w;this.height=h;};Size.prototype.toString=function(){return"("+this.width+", "+this.height+")";};Size.prototype.equals=function(s){if(!s)return false;return this.width==s.width&&this.height==s.height;};Size.prototype.approxEquals=function(s){if(!s)return false;return approxCompare(this.width,s.width)&&approxCompare(this.height,s.height);};function approxCompare(rh,Ai){return Math.round(rh*1000000)==Math.round(Ai*1000000)};