public void testToArray() throws Exception { Common.assertEquals( new float[] {testFloat3.getX(), testFloat3.getY(), testFloat3.getZ()}, testFloat3.toArray()); Common.assertEquals( new float[] {otherFloat3.getX(), otherFloat3.getY(), otherFloat3.getZ()}, otherFloat3.toArray()); }
public void testCross() throws Exception { Common.assertEquals(new Float3(-1.5f, 3, -1.5f), testFloat3.cross(otherFloat3)); }
public void testNormalised() throws Exception { float root5 = FloatMath.sqrt(5); Common.assertEquals(new Float3(0, 1f / root5, 2f / root5), testFloat3.normalised()); }
public void testScale() throws Exception { Common.assertEquals(new Float3(0, 1.5f, 3), testFloat3.scale(1.5f)); }
public void testMinus() throws Exception { Common.assertEquals(new Float3(-1.5f, -0.5f, 0.5f), testFloat3.minus(otherFloat3)); }
public void testPlus() throws Exception { Common.assertEquals(new Float3(1.5f, 2.5f, 3.5f), testFloat3.plus(otherFloat3)); }
public void testTranslate() throws Exception { Common.assertEquals( new Float3(1.5f, 2.5f, 3.5f), testFloat3.translate(otherFloat3.getX(), otherFloat3.getY(), otherFloat3.getZ())); }
public void testRotate() throws Exception { float root2 = FloatMath.sqrt(2); Common.assertEquals(new Float3(0, -root2 / 2, 3f / root2), testFloat3.rotate(45, 1, 0, 0)); }