//////////////////////////////////////////////////////////////////////////////////
// Vector2d V1.0.0
// (c) 2010 by R Cecco. <http://www.professorcloud.com>
// MIT License
//
// Please retain this copyright header in all versions of the software
//////////////////////////////////////////////////////////////////////////////////
function Vector2d(){if(arguments.length==1){this.vx=arguments[0].vx;this.vy=arguments[0].vy}else{this.vx=arguments[0];this.vy=arguments[1]}Vector2d.prototype.mul=function(a){this.vx*=a;this.vy*=a};Vector2d.prototype.add=function(a){this.vx+=a.vx;this.vy+=a.vy};Vector2d.prototype.sub=function(a){this.vx-=a.vx;this.vy-=a.vy};Vector2d.prototype.len=function(){return Math.sqrt(this.vx*this.vx+this.vy*this.vy)};Vector2d.prototype.normalise=function(){var a=Math.sqrt(this.vx*this.vx+this.vy*this.vy);this.vx/=a;this.vy/=a;return a};Vector2d.prototype.dotProd=function(a){return(this.vx*a.vx)+(this.vy*a.vy)};Vector2d.prototype.rotate=function(a){this.vx=(this.vx*Math.cos(a))-(this.vy*Math.sin(a));this.vy=(this.vy*Math.cos(a))+(this.vx*Math.sin(a))};Vector2d.prototype.negate=function(){this.vx=-this.vx;this.vy=-this.vy};Vector2d.prototype.toString=function(){return'vx = '+this.vx+', vy = '+this.vy}}
