@@ -49,11 +49,6 @@ public final class NumberUtils {
49
49
50
50
/** Smallest positive number used in double comparisons (rounding). */
51
51
public final static double EPSILON = 1e-6 ;
52
- /* PI and PI/2 constants */
53
- public final static double PI = Math .PI ;
54
- public final static double PI_HALF = PI / 2.0 ;
55
- /** Typical scale precision in re/im comparisons (rounding). */
56
- public static final double ARG_EPSILON = Math .ulp (1.0 );
57
52
/* shared Double instances */
58
53
/** shared Double = NaN instance */
59
54
public final static Double DBL_NAN = Double .valueOf (Double .NaN );
@@ -71,25 +66,6 @@ public static double getArgumentInDegrees(final double re, final double im) {
71
66
}
72
67
73
68
public static double getArgument (final double re , final double im ) {
74
- // check |re| == 0
75
- final double normRe = Math .abs (re );
76
- if (normRe == 0.0 ) {
77
- return (im >= 0.0 ) ? PI_HALF : -PI_HALF ;
78
- }
79
- // check |im| == 0
80
- final double normIm = Math .abs (im );
81
- if (normIm == 0.0 ) {
82
- return (re >= 0.0 ) ? 0.0 : PI ;
83
- }
84
- final double epsilon = ARG_EPSILON * (normRe + normIm );
85
- // check |re| << |im| or |im| << |re|
86
- if (normIm <= epsilon ) {
87
- return (re >= 0.0 ) ? 0.0 : PI ;
88
- }
89
- // check |im| << |re|
90
- if (normRe <= epsilon ) {
91
- return (im >= 0.0 ) ? PI_HALF : -PI_HALF ;
92
- }
93
69
return Math .atan2 (im , re );
94
70
}
95
71
0 commit comments