Scales a vec3 by a scalar number

@param {vec3} out the receiving vector
@param {vec3} a the vector to scale
@param {Number} b amount to scale the vector by
@returns {vec3} out
549777
function scale(out, a, b) {
  out[0] = a[0] * b;
  out[1] = a[1] * b;
  out[2] = a[2] * b;
  return out;
}
1048089
function(vec2, returnNew) {
      var x,y;
      if ('number' !== typeof vec2) { //.x !== undef) {
        x = vec2.x;
        y = vec2.y;

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

      if (!returnNew) {
        return this.set(this.x * x, this.y * y);
      } else {
        return new Vec2(
          this.x * x,
          this.y * y
        );
      }
    }
913381
function mul(a, b){
    return Vector3(a.x*b.x, a.y*b.y, a.z*b.z);
  }
146766
function bcorr(a, b) {
      if (a > b) { return bcorr(b, a); }
      // a <= b
      return stirlerr(a) + algdiv(a, b) +
               (a + b - 0.5) * Math.log(1 + a / b) +
               a * (Math.log(b) - 1);
   }
793538
function add(a, b){
    return Vector3(a.x+b.x, a.y+b.y, a.z+b.z);
  }
509727
function divide(out, a, b) {
    out[0] = a[0] / b[0]
    out[1] = a[1] / b[1]
    return out
}
447161
function(v) {
        if(v instanceof Vec3){
            return this.toVec3()._cross(v);
        }
        return new Vec3(0,0, this.x * v.y - this.y * v.x);
    }
495350
function (a, b) {
        vec3.cross(this.array, a.array, b.array);
        this._dirty = true;
        return this;
    }
193028
public static void diag( DMatrix4x4 input , DMatrix4 out ) {
        out.a1 = input.a11;
        out.a2 = input.a22;
        out.a3 = input.a33;
        out.a4 = input.a44;
    }
653163
public Vector3i mul(int scalar, Vector3i dest) {
        dest.x = x * scalar;
        dest.y = y * scalar;
        dest.z = z * scalar;
        return dest;
    }
23816
function subtract(out, a, b) {
  out[0] = a[0] - b[0];
  out[1] = a[1] - b[1];
  out[2] = a[2] - b[2];
  out[3] = a[3] - b[3];
  out[4] = a[4] - b[4];
  out[5] = a[5] - b[5];
  out[6] = a[6] - b[6];
  out[7] = a[7] - b[7];
  out[8] = a[8] - b[8];
  return out;
}
1206678
function sub(a, b){
    return Vector3(a.x-b.x, a.y-b.y, a.z-b.z);
  }
240963
function(point, out) {
        if (!out) {
            out = new Vector3();
        }
        var d = this.distanceToPoint(point);
        vec3.scaleAndAdd(out.array, point.array, this.normal.array, -d);
        out._dirty = true;
        return out;
    }
109558
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);
    }
351298
public double[] mult(double[] vec, double[] out) {
        if (out == null || out.length != 2) {
            out = new double[2];
        }

        if (vec == out) {
            double tx = m00*vec[0] + m01*vec[1] + m02;
            double ty = m10*vec[0] + m11*vec[1] + m12;

            out[0] = tx;
            out[1] = ty;
        } else {
            out[0] = m00*vec[0] + m01*vec[1] + m02;
            out[1] = m10*vec[0] + m11*vec[1] + m12;
        }

        return out;
    }
1058652
function ceil(out, a) {
  out[0] = Math.ceil(a[0]);
  out[1] = Math.ceil(a[1]);
  out[2] = Math.ceil(a[2]);
  return out;
}
1276471
function transpose(out, a) {
  // If we are transposing ourselves we can skip a few steps but have to cache some values
  if (out === a) {
    var a01 = a[1],
        a02 = a[2],
        a12 = a[5];
    out[1] = a[3];
    out[2] = a[6];
    out[3] = a01;
    out[5] = a[7];
    out[6] = a02;
    out[7] = a12;
  } else {
    out[0] = a[0];
    out[1] = a[3];
    out[2] = a[6];
    out[3] = a[1];
    out[4] = a[4];
    out[5] = a[7];
    out[6] = a[2];
    out[7] = a[5];
    out[8] = a[8];
  }

  return out;
}