@Test public void reflectZeroToOne_F32() { assertEquals(0.00f, UtilAngle.reflectZeroToOne(2.0f), GrlConstants.FLOAT_TEST_TOL); assertEquals(1.00f, UtilAngle.reflectZeroToOne(1.0f), GrlConstants.FLOAT_TEST_TOL); assertEquals(0.00f, UtilAngle.reflectZeroToOne(0.0f), GrlConstants.FLOAT_TEST_TOL); assertEquals(0.50f, UtilAngle.reflectZeroToOne(1.5f), GrlConstants.FLOAT_TEST_TOL); assertEquals(0.25f, UtilAngle.reflectZeroToOne(1.75f), GrlConstants.FLOAT_TEST_TOL); assertEquals(0.25f, UtilAngle.reflectZeroToOne(-0.25f), GrlConstants.FLOAT_TEST_TOL); assertEquals(0.25f, UtilAngle.reflectZeroToOne(0.25f), GrlConstants.FLOAT_TEST_TOL); assertEquals(0.50f, UtilAngle.reflectZeroToOne(0.50f), GrlConstants.FLOAT_TEST_TOL); assertEquals(0.50f, UtilAngle.reflectZeroToOne(-0.50f), GrlConstants.FLOAT_TEST_TOL); assertEquals(1.00f, UtilAngle.reflectZeroToOne(-1.0f), GrlConstants.FLOAT_TEST_TOL); assertEquals(0.00f, UtilAngle.reflectZeroToOne(-6.0f), GrlConstants.FLOAT_TEST_TOL); assertEquals(0.75f, UtilAngle.reflectZeroToOne(-5.25f), GrlConstants.FLOAT_TEST_TOL); }
@Test public void reflectZeroToOne_F64() { assertEquals(0.00, UtilAngle.reflectZeroToOne(2.0), GrlConstants.DOUBLE_TEST_TOL); assertEquals(1.00, UtilAngle.reflectZeroToOne(1.0), GrlConstants.DOUBLE_TEST_TOL); assertEquals(0.00, UtilAngle.reflectZeroToOne(0.0), GrlConstants.DOUBLE_TEST_TOL); assertEquals(0.50, UtilAngle.reflectZeroToOne(1.5), GrlConstants.DOUBLE_TEST_TOL); assertEquals(0.25, UtilAngle.reflectZeroToOne(1.75), GrlConstants.DOUBLE_TEST_TOL); assertEquals(0.25, UtilAngle.reflectZeroToOne(-0.25), GrlConstants.DOUBLE_TEST_TOL); assertEquals(0.25, UtilAngle.reflectZeroToOne(0.25), GrlConstants.DOUBLE_TEST_TOL); assertEquals(0.50, UtilAngle.reflectZeroToOne(0.50), GrlConstants.DOUBLE_TEST_TOL); assertEquals(0.50, UtilAngle.reflectZeroToOne(-0.50), GrlConstants.DOUBLE_TEST_TOL); assertEquals(1.00, UtilAngle.reflectZeroToOne(-1.0), GrlConstants.DOUBLE_TEST_TOL); assertEquals(0.00, UtilAngle.reflectZeroToOne(-6.0), GrlConstants.DOUBLE_TEST_TOL); assertEquals(0.75, UtilAngle.reflectZeroToOne(-5.25), GrlConstants.DOUBLE_TEST_TOL); }