index/vec2.js
function(vec2, returnNew) {
      var x,y;
      if ('number' !== typeof vec2) {
        x = vec2.x;
        y = vec2.y;

      // Handle incoming scalars
      } else {
        x = y = vec2;
      }

      if (x === 0 || y === 0) {
        throw new Error('division by zero')
      }

      if (isNaN(x) || isNaN(y)) {
        throw new Error('NaN detected');
      }

      if (returnNew) {
        return new Vec2(this.x / x, this.y / y);
      }

      return this.set(this.x / x, this.y / y);
    }
function(vec2, returnNew) {
      var x,y;
      if ('number' !== typeof vec2) {
        x = vec2.x;
        y = vec2.y;

      // Handle incoming scalars
      } else {
        x = y = vec2;
      }

      if (x === 0 || y === 0) {
        throw new Error('division by zero')
      }

      if (isNaN(x) || isNaN(y)) {
        throw new Error('NaN detected');
      }

      if (returnNew) {
        return new Vec2(this.x / x, this.y / y);
      }

      return this.set(this.x / x, this.y / y);
    }
function ( vec2 , returnNew ) { var x , y ; if ( 'number' !== typeof vec2 ) { x = vec2 . x ; y = vec2 . y ; // Handle incoming scalars } else { x = y = vec2 ; } if ( x === 0 || y === 0 ) { throw new Error ( 'division by zero' ) } if ( isNaN ( x ) || isNaN ( y ) ) { throw new Error ( 'NaN detected' ) ; } if ( returnNew ) { return new Vec2 ( this . x / x , this . y / y ) ; } return this . set ( this . x / x , this . y / y ) ; }
Divide this vector's components by a scalar
Divide this vector s components by a scalar