Exemple #1
0
  @Test
  public void testMultiplyInt() {
    Vector4 a = new Vector4(1, -1, 4, 2);
    Vector4 b = a.multiply(2, 6, 4, 1);

    doAssertDouble(2, b.x);
    doAssertDouble(-6, b.y);
    doAssertDouble(16, b.z);
    doAssertDouble(2, b.w);

    Vector4 c = a.multiply(2.0);

    doAssertDouble(2, c.x);
    doAssertDouble(-2, c.y);
    doAssertDouble(8, c.z);
    doAssertDouble(4, c.w);
  }
Exemple #2
0
  @Test
  public void testMultiplyFloat() {
    Vector4 a = new Vector4(1, -1, 4, 2);
    Vector4 b = a.multiply(2f, 6f, 4f, 1f);

    doAssertDouble(2, b.x);
    doAssertDouble(-6, b.y);
    doAssertDouble(16, b.z);
    doAssertDouble(2, b.w);

    Vector4 c = a.multiply(2.0F);

    doAssertDouble(2, c.x);
    doAssertDouble(-2, c.y);
    doAssertDouble(8, c.z);
    doAssertDouble(4, c.w);
  }
Exemple #3
0
  @Test
  public void testMultiplyDouble() {
    Vector4 a = new Vector4(1, -1, 4, 2);
    Vector4 b = a.multiply(2d, 6d, 4d, 1d);

    doAssertDouble(2, b.x);
    doAssertDouble(-6, b.y);
    doAssertDouble(16, b.z);
    doAssertDouble(2, b.w);

    Vector4 c = a.multiply(2.0d);

    doAssertDouble(2, c.x);
    doAssertDouble(-2, c.y);
    doAssertDouble(8, c.z);
    doAssertDouble(4, c.w);
  }
Exemple #4
0
  @Test
  public void testMultiplyVector4() {
    Vector4 a = new Vector4(1, -1, 4, 2);
    Vector4 b = new Vector4(2, 6, 4, 1);
    Vector4 c = a.multiply(b);

    doAssertDouble(2, c.x);
    doAssertDouble(-6, c.y);
    doAssertDouble(16, c.z);
    doAssertDouble(2, c.w);
  }