commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [commons-numbers] branch master updated: Removed redundant fields.
Date Sat, 30 Nov 2019 03:27:19 GMT
This is an automated email from the ASF dual-hosted git repository.

erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-numbers.git


The following commit(s) were added to refs/heads/master by this push:
     new 5b09ec7  Removed redundant fields.
5b09ec7 is described below

commit 5b09ec74f19be133e9084e2542b4efd682e81de6
Author: Gilles Sadowski <gilles@harfang.homelinux.org>
AuthorDate: Sat Nov 30 04:25:05 2019 +0100

    Removed redundant fields.
---
 .../commons/numbers/angle/PlaneAngleRadians.java   |  6 ------
 .../numbers/angle/PlaneAngleRadiansTest.java       | 25 +++++-----------------
 2 files changed, 5 insertions(+), 26 deletions(-)

diff --git a/commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/PlaneAngleRadians.java
b/commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/PlaneAngleRadians.java
index d03218f..a4f0edc 100644
--- a/commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/PlaneAngleRadians.java
+++ b/commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/PlaneAngleRadians.java
@@ -25,16 +25,10 @@ package org.apache.commons.numbers.angle;
 public final class PlaneAngleRadians {
     /** Value of \( \pi \): {@value}. */
     public static final double PI = Math.PI;
-    /** Value of \( -\pi \): {@value}. */
-    public static final double MINUS_PI = -PI;
     /** Value of \( 2\pi \): {@value}. */
     public static final double TWO_PI = 2 * PI;
-    /** Value of \( -2\pi \): {@value}. */
-    public static final double MINUS_TWO_PI = -TWO_PI;
     /** Value of \( \pi/2 \): {@value}. */
     public static final double PI_OVER_TWO = 0.5 * PI;
-    /** Value of \( -\pi/2 \): {@value}. */
-    public static final double MINUS_PI_OVER_TWO = -PI_OVER_TWO;
     /** Value of \( 3\pi/2 \): {@value}. */
     public static final double THREE_PI_OVER_TWO = 3 * PI_OVER_TWO;
 
diff --git a/commons-numbers-angle/src/test/java/org/apache/commons/numbers/angle/PlaneAngleRadiansTest.java
b/commons-numbers-angle/src/test/java/org/apache/commons/numbers/angle/PlaneAngleRadiansTest.java
index 8840a3b..27a99e3 100644
--- a/commons-numbers-angle/src/test/java/org/apache/commons/numbers/angle/PlaneAngleRadiansTest.java
+++ b/commons-numbers-angle/src/test/java/org/apache/commons/numbers/angle/PlaneAngleRadiansTest.java
@@ -28,14 +28,8 @@ public class PlaneAngleRadiansTest {
         final double eps = 0;
 
         Assertions.assertEquals(Math.PI, PlaneAngleRadians.PI, eps);
-        Assertions.assertEquals(-Math.PI, PlaneAngleRadians.MINUS_PI, eps);
-
         Assertions.assertEquals(2 * Math.PI, PlaneAngleRadians.TWO_PI, eps);
-        Assertions.assertEquals(-2 * Math.PI, PlaneAngleRadians.MINUS_TWO_PI, eps);
-
         Assertions.assertEquals(Math.PI / 2, PlaneAngleRadians.PI_OVER_TWO, eps);
-        Assertions.assertEquals(-Math.PI / 2, PlaneAngleRadians.MINUS_PI_OVER_TWO, eps);
-
         Assertions.assertEquals(3 * Math.PI / 2, PlaneAngleRadians.THREE_PI_OVER_TWO, eps);
     }
 
@@ -47,21 +41,12 @@ public class PlaneAngleRadiansTest {
         Assertions.assertEquals(0d, Math.sin(PlaneAngleRadians.PI), eps);
         Assertions.assertEquals(-1d, Math.cos(PlaneAngleRadians.PI), eps);
 
-        Assertions.assertEquals(0d, Math.sin(PlaneAngleRadians.MINUS_PI), eps);
-        Assertions.assertEquals(-1d, Math.cos(PlaneAngleRadians.MINUS_PI), eps);
-
         Assertions.assertEquals(0d, Math.sin(PlaneAngleRadians.TWO_PI), 2 * eps);
         Assertions.assertEquals(1d, Math.cos(PlaneAngleRadians.TWO_PI), eps);
 
-        Assertions.assertEquals(0d, Math.sin(PlaneAngleRadians.MINUS_TWO_PI), 2 * eps);
-        Assertions.assertEquals(1d, Math.cos(PlaneAngleRadians.MINUS_TWO_PI), eps);
-
         Assertions.assertEquals(1d, Math.sin(PlaneAngleRadians.PI_OVER_TWO), eps);
         Assertions.assertEquals(0d, Math.cos(PlaneAngleRadians.PI_OVER_TWO), eps);
 
-        Assertions.assertEquals(-1d, Math.sin(PlaneAngleRadians.MINUS_PI_OVER_TWO), eps);
-        Assertions.assertEquals(0d, Math.cos(PlaneAngleRadians.MINUS_PI_OVER_TWO), eps);
-
         Assertions.assertEquals(-1d, Math.sin(PlaneAngleRadians.THREE_PI_OVER_TWO), eps);
         Assertions.assertEquals(0d, Math.cos(PlaneAngleRadians.THREE_PI_OVER_TWO), eps);
     }
@@ -90,7 +75,7 @@ public class PlaneAngleRadiansTest {
     @Test
     public void testNormalizeBetweenMinusPiAndPi2() {
         final double value = 0.75 * PlaneAngleRadians.TWO_PI;
-        final double expected = PlaneAngleRadians.MINUS_PI_OVER_TWO;
+        final double expected = -PlaneAngleRadians.PI_OVER_TWO;
         final double actual = PlaneAngleRadians.normalizeBetweenMinusPiAndPi(value);
         final double tol = Math.ulp(expected);
         Assertions.assertEquals(expected, actual, tol);
@@ -98,7 +83,7 @@ public class PlaneAngleRadiansTest {
     @Test
     public void testNormalizeBetweenMinusPiAndPi3() {
         final double value = PlaneAngleRadians.PI + 1e-10;
-        final double expected = PlaneAngleRadians.MINUS_PI + 1e-10;
+        final double expected = -PlaneAngleRadians.PI + 1e-10;
         final double actual = PlaneAngleRadians.normalizeBetweenMinusPiAndPi(value);
         final double tol = Math.ulp(expected);
         Assertions.assertEquals(expected, actual, tol);
@@ -115,7 +100,7 @@ public class PlaneAngleRadiansTest {
     @Test
     public void testNormalizeBetweenMinusPiAndPi_lowerBound() {
         final double value = PlaneAngleRadians.PI;
-        final double expected = PlaneAngleRadians.MINUS_PI;
+        final double expected = -PlaneAngleRadians.PI;
         final double actual = PlaneAngleRadians.normalizeBetweenMinusPiAndPi(value);
         final double tol = Math.ulp(expected);
         Assertions.assertEquals(expected, actual, tol);
@@ -123,7 +108,7 @@ public class PlaneAngleRadiansTest {
     @Test
     public void testNormalizeBetweenMinusPiAndPi_upperBound() {
         final double value = PlaneAngleRadians.PI;
-        final double expected = PlaneAngleRadians.MINUS_PI;
+        final double expected = -PlaneAngleRadians.PI;
         final double actual = PlaneAngleRadians.normalizeBetweenMinusPiAndPi(value);
         final double tol = Math.ulp(expected);
         Assertions.assertEquals(expected, actual, tol);
@@ -147,7 +132,7 @@ public class PlaneAngleRadiansTest {
     }
     @Test
     public void testNormalizeBetweenZeroAndTwoPi3() {
-        final double value = PlaneAngleRadians.MINUS_PI + 1e-10;
+        final double value = -PlaneAngleRadians.PI + 1e-10;
         final double expected = PlaneAngleRadians.PI + 1e-10;
         final double actual = PlaneAngleRadians.normalizeBetweenZeroAndTwoPi(value);
         final double tol = Math.ulp(expected);


Mime
View raw message