Divides the vector by another.

@param vec The other vector
@return the same vector
352395
public Vector divide(Vector vec) {
        x /= vec.x;
        y /= vec.y;
        z /= vec.z;
        return this;
    }
1195743
public Vector3i mul(Vector3ic v, Vector3i dest) {
        dest.x = x * v.x();
        dest.y = y * v.y();
        dest.z = z * v.z();
        return dest;
    }
1179107
public Vector3f transform(Vector3f vec){
        return transform(vec.x, vec.y, vec.z, vec);
    }
152408
public void add(Vector v)
	{
		x += v.x;
		y += v.y;
		z += v.z;
	}
750670
public Vector midpoint(Vector other) {
        x = (x + other.x) / 2;
        y = (y + other.y) / 2;
        z = (z + other.z) / 2;
        return this;
    }
552281
public Vector add(Vector vec) {
        x += vec.x;
        y += vec.y;
        z += vec.z;
        return this;
    }
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);
    }
868744
public Vector add(double value) {
        VectorIterator it = iterator();
        Vector result = blank();

        while (it.hasNext()) {
            double x = it.next();
            int i = it.index();
            result.set(i, x + value);
        }

        return result;
    }
1102555
public double mahalanobisDistance(double[] vec) {
    double agg = 0.;
    for(int i = 0; i < vec.length; i++) {
      double diff = vec[i] - mean[i];
      agg += diff / variance * diff;
    }
    return agg;
  }
720265
function(p){
        return new Vec3(Math.pow(this.x, p), Math.pow(this.y, p), Math.pow(this.z, p));
    }
393746
public double dot(SparseVector b) {
		SparseVector a = this;
		if (a.N != b.N) throw new IllegalArgumentException("Vector lengths disagree. " + a.N + " != " + b.N);
		double sum = 0.0;

		// iterate over the vector with the fewest nonzeros
		if (a.symbolTable.size() <= b.symbolTable.size()) {
			for (int i : a.symbolTable)
				if (b.symbolTable.contains(i)) sum += a.get(i) * b.get(i);
		}
		else  {
			for (int i : b.symbolTable)
				if (a.symbolTable.contains(i)) sum += a.get(i) * b.get(i);
		}
		return sum;
	}
560309
public double dot(Vector other) {
        return x * other.x + y * other.y + z * other.z;
    }
160809
def component_mul(vec1, vec2):
        """"""
        new_vec = Vector2()
        new_vec.X = vec1.X * vec2.X
        new_vec.Y = vec1.Y * vec2.Y
        return new_vec
1109789
function() {
        return new Vec3(Math.round(this.x), Math.round(this.y), Math.round(this.z));
    }
310454
public Vector4d transform(Vector4dc vec, Vector4d dest) {
        return transform(vec.x(), vec.y(), vec.z(), dest);
    }
1015821
public IntFloatSortedVector getDiff(IntFloatVector other) {
        IntFloatSortedVector diff = new IntFloatSortedVector(this);
        diff.subtract(other);
        return diff;
    }
624099
public double divideBy(Resource other) throws RuntimeException {
    if (other.getCpu() == 0 || other.getRam().isZero() || other.getDisk().isZero()) {
      throw new RuntimeException("Division by 0.");
    } else {
      double cpuFactor = Math.ceil(this.getCpu() / other.getCpu());
      double ramFactor = Math.ceil((double) this.getRam().asBytes() / other.getRam().asBytes());
      double diskFactor = Math.ceil((double) this.getDisk().asBytes() / other.getDisk().asBytes());
      return Math.max(cpuFactor, Math.max(ramFactor, diskFactor));
    }
  }