index/vec2.js
function(r, inverse, returnNew) {
      var
      x = this.x,
      y = this.y,
      cos = Math.cos(r),
      sin = Math.sin(r),
      rx, ry;

      inverse = (inverse) ? -1 : 1;

      rx = cos * x - (inverse * sin) * y;
      ry = (inverse * sin) * x + cos * y;

      if (returnNew) {
        return new Vec2(rx, ry);
      } else {
        return this.set(rx, ry);
      }
    }
function(r, inverse, returnNew) {
      var
      x = this.x,
      y = this.y,
      cos = Math.cos(r),
      sin = Math.sin(r),
      rx, ry;

      inverse = (inverse) ? -1 : 1;

      rx = cos * x - (inverse * sin) * y;
      ry = (inverse * sin) * x + cos * y;

      if (returnNew) {
        return new Vec2(rx, ry);
      } else {
        return this.set(rx, ry);
      }
    }
function ( r , inverse , returnNew ) { var x = this . x , y = this . y , cos = Math . cos ( r ) , sin = Math . sin ( r ) , rx , ry ; inverse = ( inverse ) ? - 1 : 1 ; rx = cos * x - ( inverse * sin ) * y ; ry = ( inverse * sin ) * x + cos * y ; if ( returnNew ) { return new Vec2 ( rx , ry ) ; } else { return this . set ( rx , ry ) ; } }
Rotate this vector. Accepts a `Rotation` or angle in radians.  Passing a truthy `inverse` will cause the rotation to be reversed.  If `returnNew` is truthy, a new `Vec2` will be created with the values resulting from the rotation. Otherwise the rotation will be applied to this vector directly, and this vector will be returned.
Rotate this vector . Accepts a Rotation or angle in radians . Passing a truthy inverse will cause the rotation to be reversed . If returnNew is truthy a new Vec2 will be created with the values resulting from the rotation . Otherwise the rotation will be applied to this vector directly and this vector will be returned .