/** * Compute the * <a href="http://mathworld.wolfram.com/InverseCosine.html" TARGET="_top"> * inverse cosine</a> for the given complex argument. * <p> * Implements the formula: <pre> * <code> acos(z) = -i (log(z + i (sqrt(1 - z<sup>2</sup>))))</code></pre> * <p> * Returns {@link ComplexNum#NaN} if either real or imaginary part of the * input argument is <code>NaN</code> or infinite. * * @param z the value whose inverse cosine is to be returned * @return the inverse cosine of <code>z</code> * @throws NullPointerException if <code>z</code> is null */ public static ComplexNum acos(final ComplexNum z) { if (z.isNaN()) { return ComplexNum.NaN; } return ComplexNum.I.negate().multiply(log(z.add( ComplexNum.I.multiply(sqrt1z(z))))); }
/** * Compute the * <a href="http://mathworld.wolfram.com/InverseCosine.html" TARGET="_top"> * inverse cosine</a> for the given complex argument. * <p> * Implements the formula: <pre> * <code> acos(z) = -i (log(z + i (sqrt(1 - z<sup>2</sup>))))</code></pre> * <p> * Returns {@link ComplexNum#NaN} if either real or imaginary part of the * input argument is <code>NaN</code> or infinite. * * @param z the value whose inverse cosine is to be returned * @return the inverse cosine of <code>z</code> * @throws NullPointerException if <code>z</code> is null */ public static ComplexNum acos(final ComplexNum z) { if (z.isNaN()) { return ComplexNum.NaN; } return ComplexNum.I.negate().multiply(log(z.add( ComplexNum.I.multiply(sqrt1z(z))))); }
/** * Compute the * <a href="http://mathworld.wolfram.com/InverseSine.html" TARGET="_top"> * inverse sine</a> for the given complex argument. * <p> * Implements the formula: <pre> * <code> asin(z) = -i (log(sqrt(1 - z<sup>2</sup>) + iz)) </code></pre> * <p> * Returns {@link ComplexNum#NaN} if either real or imaginary part of the * input argument is <code>NaN</code> or infinite. * * @param z the value whose inverse sine is to be returned. * @return the inverse sine of <code>z</code>. * @throws NullPointerException if <code>z</code> is null */ public static ComplexNum asin(final ComplexNum z) { if (z.isNaN()) { return ComplexNum.NaN; } return ComplexNum.I.negate().multiply(log(sqrt1z(z).add( ComplexNum.I.multiply(z)))); }
/** * Compute the * <a href="http://mathworld.wolfram.com/InverseSine.html" TARGET="_top"> * inverse sine</a> for the given complex argument. * <p> * Implements the formula: <pre> * <code> asin(z) = -i (log(sqrt(1 - z<sup>2</sup>) + iz)) </code></pre> * <p> * Returns {@link ComplexNum#NaN} if either real or imaginary part of the * input argument is <code>NaN</code> or infinite. * * @param z the value whose inverse sine is to be returned. * @return the inverse sine of <code>z</code>. * @throws NullPointerException if <code>z</code> is null */ public static ComplexNum asin(final ComplexNum z) { if (z.isNaN()) { return ComplexNum.NaN; } return ComplexNum.I.negate().multiply(log(sqrt1z(z).add( ComplexNum.I.multiply(z)))); }