diff --git a/src/main/java/fr/jmmc/jmcs/util/NumberUtils.java b/src/main/java/fr/jmmc/jmcs/util/NumberUtils.java index 35918c5..79ad089 100644 --- a/src/main/java/fr/jmmc/jmcs/util/NumberUtils.java +++ b/src/main/java/fr/jmmc/jmcs/util/NumberUtils.java @@ -49,11 +49,6 @@ public final class NumberUtils { /** Smallest positive number used in double comparisons (rounding). */ public final static double EPSILON = 1e-6; - /* PI and PI/2 constants */ - public final static double PI = Math.PI; - public final static double PI_HALF = PI / 2.0; - /** Typical scale precision in re/im comparisons (rounding). */ - public static final double ARG_EPSILON = Math.ulp(1.0); /* shared Double instances */ /** shared Double = NaN instance */ public final static Double DBL_NAN = Double.valueOf(Double.NaN); @@ -71,25 +66,6 @@ public static double getArgumentInDegrees(final double re, final double im) { } public static double getArgument(final double re, final double im) { - // check |re| == 0 - final double normRe = Math.abs(re); - if (normRe == 0.0) { - return (im >= 0.0) ? PI_HALF : -PI_HALF; - } - // check |im| == 0 - final double normIm = Math.abs(im); - if (normIm == 0.0) { - return (re >= 0.0) ? 0.0 : PI; - } - final double epsilon = ARG_EPSILON * (normRe + normIm); - // check |re| << |im| or |im| << |re| - if (normIm <= epsilon) { - return (re >= 0.0) ? 0.0 : PI; - } - // check |im| << |re| - if (normRe <= epsilon) { - return (im >= 0.0) ? PI_HALF : -PI_HALF; - } return Math.atan2(im, re); }