Vector3 implements Cloneable, Savable, Externalizable, ReadOnlyVector3, Poolable { @Override public Vector3 divide(final double scalar, final Vector3 store) { Vector3 result = store; if (result == null) { result = new Vector3(); } return result.set(getX() / scalar, getY() / scalar, getZ() / scalar); } Vector3();  Vector3(final ReadOnlyVector3 src);  Vector3(final double x, final double y, final double z); @Override double getX(); @Override double getY(); @Override double getZ(); @Override float getXf(); @Override float getYf(); @Override float getZf(); @Override double getValue(final int index); void setValue(final int index, final double value); @Override double[] toArray(double[] store); float[] toFloatArray(float[] store); void setX(final double x); void setY(final double y); void setZ(final double z); Vector3 set(final double x, final double y, final double z); Vector3 set(final ReadOnlyVector3 source); Vector3 zero(); @Override Vector3 add(final double x, final double y, final double z, final Vector3 store); Vector3 addLocal(final double x, final double y, final double z); @Override Vector3 add(final ReadOnlyVector3 source, final Vector3 store); Vector3 addLocal(final ReadOnlyVector3 source); @Override Vector3 subtract(final double x, final double y, final double z, final Vector3 store); Vector3 subtractLocal(final double x, final double y, final double z); @Override Vector3 subtract(final ReadOnlyVector3 source, final Vector3 store); Vector3 subtractLocal(final ReadOnlyVector3 source); @Override Vector3 multiply(final double scalar, final Vector3 store); Vector3 multiplyLocal(final double scalar); @Override Vector3 multiply(final ReadOnlyVector3 scale, final Vector3 store); Vector3 multiplyLocal(final ReadOnlyVector3 scale); @Override Vector3 multiply(final double x, final double y, final double z, final Vector3 store); Vector3 multiplyLocal(final double x, final double y, final double z); @Override Vector3 divide(final double scalar, final Vector3 store); Vector3 divideLocal(final double scalar); @Override Vector3 divide(final ReadOnlyVector3 scale, final Vector3 store); Vector3 divideLocal(final ReadOnlyVector3 scale); @Override Vector3 divide(final double x, final double y, final double z, final Vector3 store); Vector3 divideLocal(final double x, final double y, final double z); Vector3 scaleAddLocal(final double scale, final ReadOnlyVector3 add); @Override Vector3 scaleAdd(final double scale, final ReadOnlyVector3 add, final Vector3 store); @Override Vector3 negate(final Vector3 store); Vector3 negateLocal(); @Override Vector3 normalize(final Vector3 store); Vector3 normalizeLocal(); @Override Vector3 lerp(final ReadOnlyVector3 endVec, final double scalar, final Vector3 store); Vector3 lerpLocal(final ReadOnlyVector3 endVec, final double scalar); static Vector3 lerp(final ReadOnlyVector3 beginVec, final ReadOnlyVector3 endVec, final double scalar,
      final Vector3 store); Vector3 lerpLocal(final ReadOnlyVector3 beginVec, final ReadOnlyVector3 endVec, final double scalar); @Override double length(); @Override double lengthSquared(); @Override double distanceSquared(final double x, final double y, final double z); @Override double distanceSquared(final ReadOnlyVector3 destination); @Override double distance(final double x, final double y, final double z); @Override double distance(final ReadOnlyVector3 destination); @Override double dot(final double x, final double y, final double z); @Override double dot(final ReadOnlyVector3 vec); @Override Vector3 cross(final double x, final double y, final double z, final Vector3 store); @Override Vector3 cross(final ReadOnlyVector3 vec, final Vector3 store); Vector3 crossLocal(final double x, final double y, final double z); Vector3 crossLocal(final ReadOnlyVector3 vec); @Override double smallestAngleBetween(final ReadOnlyVector3 otherVector); static boolean isValid(final ReadOnlyVector3 vector); static boolean isInfinite(final ReadOnlyVector3 vector); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object o); @Override Vector3 clone(); @Override Class<? extends Vector3> getClassTag(); @Override void write(final OutputCapsule capsule); @Override void read(final InputCapsule capsule); @Override void readExternal(final ObjectInput in); @Override void writeExternal(final ObjectOutput out); final static Vector3 fetchTempInstance(); final static void releaseTempInstance(final Vector3 vec); final static ReadOnlyVector3 ZERO; final static ReadOnlyVector3 ONE; final static ReadOnlyVector3 NEG_ONE; final static ReadOnlyVector3 UNIT_X; final static ReadOnlyVector3 NEG_UNIT_X; final static ReadOnlyVector3 UNIT_Y; final static ReadOnlyVector3 NEG_UNIT_Y; final static ReadOnlyVector3 UNIT_Z; final static ReadOnlyVector3 NEG_UNIT_Z; }
@Test public void testDivide() { final Vector3 vec1 = new Vector3(1, -1, 2); final Vector3 vec2 = vec1.divide(2.0, null); final Vector3 vec2B = vec1.divide(2.0, new Vector3()); assertEquals(new Vector3(0.5, -0.5, 1.0), vec2); assertEquals(new Vector3(0.5, -0.5, 1.0), vec2B); vec2.divideLocal(0.5); assertEquals(new Vector3(1.0, -1.0, 2.0), vec2); final Vector3 vec3 = vec1.divide(vec2, null); final Vector3 vec3B = vec1.divide(vec2, new Vector3()); assertEquals(Vector3.ONE, vec3); assertEquals(Vector3.ONE, vec3B); final Vector3 vec4 = vec1.divide(2, 3, 4, null); final Vector3 vec4B = vec1.divide(2, 3, 4, new Vector3()); assertEquals(new Vector3(0.5, -1 / 3., 0.5), vec4); assertEquals(new Vector3(0.5, -1 / 3., 0.5), vec4B); vec1.divideLocal(0.5, 0.5, 0.5); assertEquals(new Vector3(2, -2, 4), vec1); vec1.divideLocal(vec2); assertEquals(new Vector3(2, 2, 2), vec1); }