コード例 #1
0
 @Test
 public void wrapZeroToOne_F32() {
   assertEquals(0.00f, UtilAngle.wrapZeroToOne(2.0f), GrlConstants.FLOAT_TEST_TOL);
   assertEquals(0.00f, UtilAngle.wrapZeroToOne(1.0f), GrlConstants.FLOAT_TEST_TOL);
   assertEquals(0.00f, UtilAngle.wrapZeroToOne(0.0f), GrlConstants.FLOAT_TEST_TOL);
   assertEquals(0.50f, UtilAngle.wrapZeroToOne(1.5f), GrlConstants.FLOAT_TEST_TOL);
   assertEquals(0.00f, UtilAngle.wrapZeroToOne(-1.0f), GrlConstants.FLOAT_TEST_TOL);
   assertEquals(0.00f, UtilAngle.wrapZeroToOne(-6.0f), GrlConstants.FLOAT_TEST_TOL);
   assertEquals(0.25f, UtilAngle.wrapZeroToOne(0.25f), GrlConstants.FLOAT_TEST_TOL);
   assertEquals(0.50f, UtilAngle.wrapZeroToOne(0.50f), GrlConstants.FLOAT_TEST_TOL);
   assertEquals(0.75f, UtilAngle.wrapZeroToOne(-0.25f), GrlConstants.FLOAT_TEST_TOL);
   assertEquals(0.75f, UtilAngle.wrapZeroToOne(-5.25f), GrlConstants.FLOAT_TEST_TOL);
   assertEquals(0.50f, UtilAngle.wrapZeroToOne(-0.50f), GrlConstants.FLOAT_TEST_TOL);
 }
コード例 #2
0
 @Test
 public void wrapZeroToOne_F64() {
   assertEquals(0.00, UtilAngle.wrapZeroToOne(2.0), GrlConstants.DOUBLE_TEST_TOL);
   assertEquals(0.00, UtilAngle.wrapZeroToOne(1.0), GrlConstants.DOUBLE_TEST_TOL);
   assertEquals(0.00, UtilAngle.wrapZeroToOne(0.0), GrlConstants.DOUBLE_TEST_TOL);
   assertEquals(0.50, UtilAngle.wrapZeroToOne(1.5), GrlConstants.DOUBLE_TEST_TOL);
   assertEquals(0.00, UtilAngle.wrapZeroToOne(-1.0), GrlConstants.DOUBLE_TEST_TOL);
   assertEquals(0.00, UtilAngle.wrapZeroToOne(-6.0), GrlConstants.DOUBLE_TEST_TOL);
   assertEquals(0.25, UtilAngle.wrapZeroToOne(0.25), GrlConstants.DOUBLE_TEST_TOL);
   assertEquals(0.50, UtilAngle.wrapZeroToOne(0.50), GrlConstants.DOUBLE_TEST_TOL);
   assertEquals(0.75, UtilAngle.wrapZeroToOne(-0.25), GrlConstants.DOUBLE_TEST_TOL);
   assertEquals(0.75, UtilAngle.wrapZeroToOne(-5.25), GrlConstants.DOUBLE_TEST_TOL);
   assertEquals(0.50, UtilAngle.wrapZeroToOne(-0.50), GrlConstants.DOUBLE_TEST_TOL);
 }