public Complex evaluate(Complex arg1, Complex arg2) { return arg1.add(arg2); }
/** * Evaluate. * * @param arg1 the arg 1 * @param arg2 the arg 2 * @return the complex */ @Override public Complex evaluate( Complex arg1, Complex arg2 ) { return arg1.add( arg2 ); }
public Complex evaluate(IEvaluator<Complex, ComplexVariable> engine, FunctionNode function) { Complex result = new Complex(0.0, 0.0); for (int i = 1; i < function.size(); i++) { result = result.add(engine.evaluateNode(function.getNode(i))); } return result; } }
/** * Evaluate. * * @param engine the engine * @param function the function * @return the complex */ @Override public Complex evaluate( IEvaluator<Complex, ComplexVariable> engine, FunctionNode function ) { Complex result = new Complex( 0.0, 0.0 ); for ( int i = 1; i < function.size(); i++ ) { result = result.add( engine.evaluateNode( function.getNode( i ) ) ); } return result; } }
/** * Compute the * <a href="http://mathworld.wolfram.com/InverseSine.html" TARGET="_top"> * inverse sine</a> of this complex number. Implements the formula: * * <pre> * <code> asin(z) = -i (log(sqrt(1 - z<sup>2</sup>) + iz)) </code> * </pre> * * Returns {@link org.matheclipse.parser.client.math.Complex#NaN} if either * real or imaginary part of the input argument is <code>NaN</code> or * infinite. * * @return the inverse sine of this complex number. * @since 1.2 */ public Complex asin() { if ( isNaN() ) { return Complex.NaN; } return sqrt1z().add( this.multiply( Complex.I ) ).log().multiply( Complex.I.negate() ); }
/** * Compute the <a href="http://mathworld.wolfram.com/InverseSine.html" * TARGET="_top"> inverse sine</a> of this complex number. * <p> * Implements the formula: * * <pre> * <code> asin(z) = -i (log(sqrt(1 - z<sup>2</sup>) + iz)) </code> * </pre> * * </p> * <p> * Returns {@link Complex#NaN} if either real or imaginary part of the input * argument is <code>NaN</code> or infinite. * </p> * * @return the inverse sine of this complex number. * @since 1.2 */ public Complex asin() { if (isNaN()) { return Complex.NaN; } return sqrt1z().add(this.multiply(Complex.I)).log().multiply(Complex.I.negate()); }
/** * Compute the <a href="http://mathworld.wolfram.com/InverseCosine.html" * TARGET="_top"> inverse cosine</a> of this complex number. * <p> * Implements the formula: * * <pre> * <code> acos(z) = -i (log(z + i (sqrt(1 - z<sup>2</sup>))))</code> * </pre> * * </p> * <p> * Returns {@link Complex#NaN} if either real or imaginary part of the input * argument is <code>NaN</code> or infinite. * </p> * * @return the inverse cosine of this complex number * @since 1.2 */ public Complex acos() { if (isNaN()) { return Complex.NaN; } return this.add(this.sqrt1z().multiply(Complex.I)).log().multiply(Complex.I.negate()); }
/** * Compute the * <a href="http://mathworld.wolfram.com/InverseCosine.html" TARGET="_top"> * inverse cosine</a> of this complex number. Implements the formula: * * <pre> * <code> acos(z) = -i (log(z + i (sqrt(1 - z<sup>2</sup>))))</code> * </pre> * * Returns {@link org.matheclipse.parser.client.math.Complex#NaN} if either * real or imaginary part of the input argument is <code>NaN</code> or * infinite. * * @return the inverse cosine of this complex number * @since 1.2 */ public Complex acos() { if ( isNaN() ) { return Complex.NaN; } return this.add( this.sqrt1z().multiply( Complex.I ) ).log().multiply( Complex.I.negate() ); }
/** * Compute the * <a href="http://mathworld.wolfram.com/InverseTangent.html" TARGET="_top"> * inverse tangent</a> of this complex number. Implements the formula: * * <pre> * <code> atan(z) = (i/2) log((i + z)/(i - z)) </code> * </pre> * * Returns {@link org.matheclipse.parser.client.math.Complex#NaN} if either * real or imaginary part of the input argument is <code>NaN</code> or * infinite. * * @return the inverse tangent of this complex number * @since 1.2 */ public Complex atan() { if ( isNaN() ) { return Complex.NaN; } return this.add( Complex.I ).divide( Complex.I.subtract( this ) ).log().multiply( Complex.I.divide( createComplex( 2.0, 0.0 ) ) ); }
/** * Compute the <a href="http://mathworld.wolfram.com/InverseTangent.html" * TARGET="_top"> inverse tangent</a> of this complex number. * <p> * Implements the formula: * * <pre> * <code> atan(z) = (i/2) log((i + z)/(i - z)) </code> * </pre> * * </p> * <p> * Returns {@link Complex#NaN} if either real or imaginary part of the input * argument is <code>NaN</code> or infinite. * </p> * * @return the inverse tangent of this complex number * @since 1.2 */ public Complex atan() { if (isNaN()) { return Complex.NaN; } return this.add(Complex.I).divide(Complex.I.subtract(this)).log().multiply(Complex.I.divide(createComplex(2.0, 0.0))); }