@Override public Vector4D32 createTuple(double x, double y, double z, double s) { return new Vector4D32((float) x, (float) y, (float) z, (float) s); }
@Override public Vector4D32 createEmptyTuple() { return new Vector4D32(); }
Vector4D32 vector = new Vector4D32(); assertTrue(vector.getX32() == 0.0f); assertTrue(vector.getY32() == 0.0f); float z = random.nextFloat(); float s = random.nextFloat(); Vector4D32 vector = new Vector4D32(x, y, z, s); assertTrue(vector.getX32() == x); assertTrue(vector.getY32() == y); float s = random.nextFloat(); float[] vectorArray = {x, y, z, s}; Vector4D32 vector = new Vector4D32(vectorArray); assertTrue(vector.getX32() == x); assertTrue(vector.getY32() == y); Vector4D32 vector = new Vector4D32(quaternion); EuclidCoreTestTools.assertTuple4DEquals(quaternion, vector, EPS); Vector4D32 vector = new Vector4D32(quaternion); EuclidCoreTestTools.assertTuple4DEquals(quaternion, vector, EPS); Vector4D32 vector = new Vector4D32(vector3D); for (int i = 0; i < 3; i++) assertTrue(vector.getElement32(i) == vector3D.getElement32(i)); Vector4D32 vector = new Vector4D32(point3D); for (int i = 0; i < 3; i++) assertTrue(vector.getElement32(i) == point3D.getElement32(i));
public static Vector4D32 nextVector4D32(Random random, Tuple4DReadOnly lowerBound, Tuple4DReadOnly upperBound) { Vector4D32 ret = new Vector4D32(); ret.setX(RandomNumbers.nextFloat(random, lowerBound.getX32(), upperBound.getX32())); ret.setY(RandomNumbers.nextFloat(random, lowerBound.getY32(), upperBound.getY32())); ret.setZ(RandomNumbers.nextFloat(random, lowerBound.getZ32(), upperBound.getZ32())); ret.setS(RandomNumbers.nextFloat(random, lowerBound.getS32(), upperBound.getS32())); return ret; }