/** * Creates using the coordinates (x, y, z). * * @param x X-position of the new vector * @param y Y-position of the new vector * @param z Z-position of the new vector */ public Vector(double x, double y, double z) { set(x, y, z); }
/** * Creates a copy of the given vector. * * @param vec Vector to copy */ public Vector(Vector vec) { set(vec); this.cachedMagnitude = vec.cachedMagnitude; }
/** * Set this vector to the given vector. * * @param vec Vector to set to * @return this */ public Vector set(Vector vec) { set(vec.x(), vec.y(), vec.z()); return this; }