@Test public void testSet() { Vector3 vector = Vector3.zero(); assertThat(vector.isCloseTo(Vector3f.ZERO_VECTOR)).isTrue(); vector.set(0, 42); assertThat(vector.isCloseTo(Vector3.fromXYZ(42, 0, 0))).isTrue(); vector.set(1, 21); assertThat(vector.isCloseTo(Vector3.fromXYZ(42, 21, 0))).isTrue(); vector.set(2, 10); assertThat(vector.isCloseTo(Vector3.fromXYZ(42, 21, 10))).isTrue(); assertThatThrownBy(() -> vector.set(3, 1)).isInstanceOfAny(IllegalArgumentException.class); vector.set(Vector2.fromXY(42, 1337), 3.14); assertThat(vector).isEqualTo(Vector3.fromXYZ(42, 1337, 3.14)); }
public void set(final IVector2 xy, final double z) { x = xy.x(); y = xy.y(); this.z = z; }
Vector3 extends AVector3 { public void set(final IVector2 xy, final double z) { x = xy.x(); y = xy.y(); this.z = z; } }
Vector3 extends AVector3 { public void set(final IVector2 xy, final double z) { x = xy.x(); y = xy.y(); this.z = z; } @SuppressWarnings("unused") private  Vector3(); private  Vector3(final double x, final double y, final double z); private  Vector3(final IVector3 original); }
Vector3 extends AVector3 { public void set(final IVector2 xy, final double z) { x = xy.x(); y = xy.y(); this.z = z; } @SuppressWarnings("unused") private  Vector3(); private  Vector3(final double x, final double y, final double z); private  Vector3(final IVector3 original); static IVector3 valueOf(final String value); static Vector3 zero(); static Vector3 fromXYZ(final double x, final double y, final double z); static Vector3 fromXY(final double x, final double y); static Vector3 from2d(final IVector2 xy, final double z); static Vector3 copy(final IVector3 original); static Vector3 fromArray(final double[] arr); static Vector3 fromProjection(final IVector3 origin, final IVector2 ground, final double height); @Override IVector3 copy(); void set(final IVector2 xy, final double z); void set(final IVector3 xyz); void setXY(final IVector2 xy); void set(final int i, final double value); Vector3 add(final IVector3 vector); Vector3 subtract(final IVector3 vector); Vector3 multiply(final double f); Vector3 apply(final Function<Double, Double> function); @Override Vector3 getXYZVector(); @Override double x(); @Override double y(); @Override double z(); }
Vector3 extends AVector3 { public void set(final IVector2 xy, final double z) { x = xy.x(); y = xy.y(); this.z = z; } @SuppressWarnings("unused") private  Vector3(); private  Vector3(final double x, final double y, final double z); private  Vector3(final IVector3 original); static IVector3 valueOf(final String value); static Vector3 zero(); static Vector3 fromXYZ(final double x, final double y, final double z); static Vector3 fromXY(final double x, final double y); static Vector3 from2d(final IVector2 xy, final double z); static Vector3 copy(final IVector3 original); static Vector3 fromArray(final double[] arr); static Vector3 fromProjection(final IVector3 origin, final IVector2 ground, final double height); @Override IVector3 copy(); void set(final IVector2 xy, final double z); void set(final IVector3 xyz); void setXY(final IVector2 xy); void set(final int i, final double value); Vector3 add(final IVector3 vector); Vector3 subtract(final IVector3 vector); Vector3 multiply(final double f); Vector3 apply(final Function<Double, Double> function); @Override Vector3 getXYZVector(); @Override double x(); @Override double y(); @Override double z();  }