/** * Return the absolute value of this complex number. * <p> * Returns <code>NaN</code> if either real or imaginary part is * <code>NaN</code> and <code>Double.POSITIVE_INFINITY</code> if neither part * is <code>NaN</code>, but at least one part takes an infinite value. * * @return the absolute value */ public double dabs() { if (isNaN()) { return Double.NaN; } if (isInfinite()) { return Double.POSITIVE_INFINITY; } if (Math.abs(getReal()) < Math.abs(getImaginary())) { if (getImaginary() == 0.0) { return Math.abs(getReal()); } final double q = getReal() / getImaginary(); return (Math.abs(getImaginary()) * Math.sqrt(1 + q * q)); } else { if (getReal() == 0.0) { return Math.abs(getImaginary()); } final double q = getImaginary() / getReal(); return (Math.abs(getReal()) * Math.sqrt(1 + q * q)); } }
final double expA = Math.exp(z.getReal()); return ComplexNum.valueOf(expA * Math.cos(b), expA * Math.sin(b));
Math.atan2(z.getImaginary(), z.getReal()));
final double a2 = 2.0 * z.getReal(); final double b2 = 2.0 * z.getImaginary(); final double d = Math.cos(a2) + MathUtils.cosh(b2);
final double a = z.getReal(); final double b = z.getImaginary();
final double a = z.getReal(); final double b = z.getImaginary();
final double a = z.getReal(); final double b = z.getImaginary();
final double a2 = 2.0 * z.getReal(); final double b2 = 2.0 * z.getImaginary(); final double d = MathUtils.cosh(a2) + Math.cos(b2);
final double a = z.getReal(); final double b = z.getImaginary();
final double a = z.getReal(); final double b = z.getImaginary();