From fc4cf07ca33d3a0eba48f9de55957ed1a4662025 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 12 Feb 2013 17:27:23 -0800 Subject: [PATCH] Nixed mirrorAngleOrigin because it's not correct. The correct way to mirror an angle in [-PI, PI] around the x-axis is simply to negate it, which doesn't seem ceremonious enough to require a utility method. --- src/main/java/pythagoras/d/MathUtil.java | 9 --------- src/main/java/pythagoras/f/MathUtil.java | 9 --------- src/test/java/pythagoras/f/MathUtilTest.java | 5 ----- 3 files changed, 23 deletions(-) diff --git a/src/main/java/pythagoras/d/MathUtil.java b/src/main/java/pythagoras/d/MathUtil.java index 9b255ef..fcf7413 100644 --- a/src/main/java/pythagoras/d/MathUtil.java +++ b/src/main/java/pythagoras/d/MathUtil.java @@ -174,15 +174,6 @@ public class MathUtil return (a > 0f ? Math.PI : -Math.PI) - a; } - /** - * Returns the mirror angle of the specified angle (assumed to be in [-pi, +pi]). The angle is - * mirrored around the origin (zero degrees). One can visualize this as mirroring around the - * "x-axis". - */ - public static double mirrorAngleOrigin (double a) { - return a + (a > 0f ? -Math.PI : Math.PI); - } - /** * Sets the number of decimal places to show when formatting values. By default, they are * formatted to three decimal places. diff --git a/src/main/java/pythagoras/f/MathUtil.java b/src/main/java/pythagoras/f/MathUtil.java index 96b6e6e..e15e3c2 100644 --- a/src/main/java/pythagoras/f/MathUtil.java +++ b/src/main/java/pythagoras/f/MathUtil.java @@ -174,15 +174,6 @@ public class MathUtil return (a > 0f ? FloatMath.PI : -FloatMath.PI) - a; } - /** - * Returns the mirror angle of the specified angle (assumed to be in [-pi, +pi]). The angle is - * mirrored around the origin (zero degrees). One can visualize this as mirroring around the - * "x-axis". - */ - public static float mirrorAngleOrigin (float a) { - return a + (a > 0f ? -FloatMath.PI : FloatMath.PI); - } - /** * Sets the number of decimal places to show when formatting values. By default, they are * formatted to three decimal places. diff --git a/src/test/java/pythagoras/f/MathUtilTest.java b/src/test/java/pythagoras/f/MathUtilTest.java index 569e76f..20c0a55 100644 --- a/src/test/java/pythagoras/f/MathUtilTest.java +++ b/src/test/java/pythagoras/f/MathUtilTest.java @@ -30,9 +30,4 @@ public class MathUtilTest assertEquals(MathUtil.lerpa(3*PI4, -3*PI4, 0.5f), -PI, MathUtil.EPSILON); } - - @Test public void testMirrorAngleOrigin() { - assertEquals(-PI2, MathUtil.mirrorAngleOrigin(PI2), MathUtil.EPSILON); - assertEquals(PI2, MathUtil.mirrorAngleOrigin(-PI2), MathUtil.EPSILON); - } }