Package mikera.vectorz

Examples of mikera.vectorz.AVector.magnitude()


    AVector axis = Vectorz.createUniformRandomVector(3);
    double angle = Math.random();
    Matrix33 rot = Matrixx.createRotationMatrix(axis, angle);

    AVector r = rot.transform(v);
    assertEquals(v.magnitude(), r.magnitude(), 0.00001);

    Matrix33 inv = rot.inverse();
    AVector ri = inv.transform(r);
    assertTrue(v.epsilonEquals(ri));
  }
View Full Code Here


      AMatrix m = Matrixx.createScaleMatrix(i, 2.3);

      m.transform(v, tv);

      assertEquals(v.magnitude() * 2.3, tv.magnitude(), 0.0001);
    }
  }

  @Test
  public void testBasicDeterminant() {
View Full Code Here

   
    AVector r=rot.transform(v);
    assertEquals(v.get(0),r.get(0),0.00001);
    assertEquals(v.get(1),r.get(1),0.00001);
    assertEquals(v.get(2),r.get(2),0.00001);
    assertEquals(v.magnitude(),r.magnitude(),0.00001);
    assertTrue(r.epsilonEquals(v));
  }
 
  private void doInverseTest(AMatrix m) {
    assert(m.rowCount()==m.columnCount());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.