@Test public void testMultiply() { Vector3 vec1 = Vector3.fromXYZ(4, 7, -2); double factor = 4.5; vec1.multiply(factor); assertEquals(Vector3.fromXYZ(18, 31.5, -9), vec1); vec1 = Vector3.fromXYZ(1, 1, 1); factor = AngleMath.PI; vec1.multiply(factor); assertEquals(vec1.x(), factor, ACCURACY); assertEquals(vec1.y(), factor, ACCURACY); assertEquals(vec1.z(), factor, ACCURACY); vec1 = Vector3.fromXYZ(3, -5, 5); factor = -2.1f; vec1.multiply(factor); assertEquals(vec1.x(), -6.3f, ACCURACY); assertEquals(vec1.y(), 10.5, ACCURACY); assertEquals(vec1.z(), -10.5, ACCURACY); factor = 0; vec1.multiply(factor); assertThat(Vector3.fromXYZ(0, 0, 0).isCloseTo(vec1)).isTrue(); }
public Vector3 multiply(final double f) { x *= f; y *= f; z *= f; return this; }
Vector3 extends AVector3 { public Vector3 multiply(final double f) { x *= f; y *= f; z *= f; return this; } }
Vector3 extends AVector3 { public Vector3 multiply(final double f) { x *= f; y *= f; z *= f; return this; } @SuppressWarnings("unused") private  Vector3(); private  Vector3(final double x, final double y, final double z); private  Vector3(final IVector3 original); }
Vector3 extends AVector3 { public Vector3 multiply(final double f) { x *= f; y *= f; z *= f; return this; } @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 Vector3 multiply(final double f) { x *= f; y *= f; z *= f; return this; } @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();  }