ComplexNum
org.matheclipse.core.expression

Class ComplexNum

    • Field Detail

      • I

        public static final ComplexNum I
        The square root of -1. A number representing "0.0 + 1.0i"
      • NaN

        public static final ComplexNum NaN
        A complex number representing "NaN + NaNi"
      • ONE

        public static final ComplexNum ONE
        A complex number representing "1.0 + 0.0i"
      • ZERO

        public static final ComplexNum ZERO
        A complex number representing "0.0 + 0.0i"
    • Method Detail

      • valueOf

        public static ComplexNum valueOf(double real)
      • valueOf

        public static ComplexNum valueOf(double real,                 double imaginary)
      • isZero

        public boolean isZero()
        Description copied from interface: IExpr
        Test if this expression equals 0 in symbolic or numeric mode.
        Specified by:
        isZero in interface IExpr
        Overrides:
        isZero in class ExprImpl
      • hierarchy

        public int hierarchy()
        Description copied from interface: IExpr
        A unique integer ID for the implementation of this expression
        Specified by:
        hierarchy in interface IExpr
        Returns:
        a unique integer id for the implementation of this expression
      • divide

        public Complex divide(Complex that)
        Parameters:
        that -
        Returns:
      • equals

        public boolean equals(Object obj)
        Description copied from interface: Element
        Test if this is equal to b.
        Specified by:
        equals in interface Element<IExpr>
        Overrides:
        equals in class Object
        Parameters:
        that -
        tolerance -
        Returns:
      • evaluate

        public IExpr evaluate(EvalEngine engine)
        Evaluate an expression
        Specified by:
        evaluate in interface IExpr
        Overrides:
        evaluate in class ExprImpl
        Parameters:
        engine - the evaluation engine
        Returns:
        the evaluated Object or null if the evaluation is not possible (i.e. the evaluation doesn't change the object).
      • isSame

        public boolean isSame(IExpr expression,             double epsilon)
        Description copied from interface: IExpr
        Test if this expression equals the given expression. If the compared expressions are of the same numeric type, they are equal to a given EPSILON
        Specified by:
        isSame in interface IExpr
        Overrides:
        isSame in class ExprImpl
      • dabs

        public double dabs()
        Return the absolute value of this complex number.

        Returns NaN if either real or imaginary part is NaN and Double.POSITIVE_INFINITY if neither part is NaN, but at least one part takes an infinite value.

        Specified by:
        dabs in interface IComplexNum
        Returns:
        the absolute value
      • eabs

        public Num eabs()
        Description copied from interface: INumber
        Get the absolute value for a given number
        Specified by:
        eabs in interface INumber
        Returns:
      • getImaginary

        public double getImaginary()
        Returns:
      • getReal

        public double getReal()
        Returns:
      • hashCode

        public final int hashCode()
        Description copied from interface: Element
        Hashcode of this Element.
        Specified by:
        hashCode in interface Element<IExpr>
        Overrides:
        hashCode in class Object
        Returns:
        the hashCode.
      • isInfinite

        public boolean isInfinite()
        Returns:
      • isNaN

        public boolean isNaN()
        Returns:
      • inverse

        public IExpr inverse()
        Description copied from interface: IExpr
        Returns the multiplicative inverse of this object. It is the object such as this.times(this.inverse()) == ONE , with ONE being the multiplicative identity.
        Specified by:
        inverse in interface MonoidElem<IExpr>
        Specified by:
        inverse in interface IExpr
        Overrides:
        inverse in class ExprImpl
        Parameters:
        isPreserved -
        Returns:
      • subtract

        public Complex subtract(Complex that)
        Parameters:
        that -
        Returns:
      • times

        public IExpr times(IExpr that)
        Description copied from interface: IExpr
        Returns the product of this object with the one specified.
        Specified by:
        times in interface IExpr
        Overrides:
        times in class ExprImpl
        Parameters:
        that -
        Returns:
      • complexSign

        public int complexSign()
        Description copied from interface: INumber
        Gets the signum value of a complex number
        Specified by:
        complexSign in interface INumber
        Returns:
      • compareTo

        public int compareTo(Complex that)
      • compareTo

        public int compareTo(IExpr obj)
        Compares this expression with the specified expression for order. Returns a negative integer, zero, or a positive integer as this expression is canonical less than, equal to, or greater than the specified expression.
        Specified by:
        compareTo in interface Element<IExpr>
        Specified by:
        compareTo in interface Comparable<IExpr>
        Specified by:
        compareTo in interface IExpr
        Returns:
        0 if this is equal to b, -1 if this is less then b, else +1.
      • head

        public ISymbol head()
        Description copied from interface: IExpr
        If this object is an instance of IAST get the first element (offset 0) of the IAST list (i.e. get(0) ).
        Specified by:
        head in interface IExpr
        Specified by:
        head in class ExprImpl
        Returns:
        the head of the expression, which must not be null.
      • getComplex

        public Complex getComplex()
      • getCMComplex

        public Complex getCMComplex()
      • accept

        public <T> T accept(IVisitor<T> visitor)
        Accept a visitor with return type T
        Specified by:
        accept in interface IExpr
      • accept

        public boolean accept(IVisitorBoolean visitor)
        Accept a visitor with return type boolean
        Specified by:
        accept in interface IExpr
      • accept

        public int accept(IVisitorInt visitor)
        Accept a visitor with return type int
        Specified by:
        accept in interface IExpr
        Returns:
      • equalsInt

        public boolean equalsInt(int i)
        Description copied from interface: INumber
        Is this number equal an integer number?
        Specified by:
        equalsInt in interface INumber
        Returns:
      • getIm

        public ISignedNumber getIm()
        Returns the imaginary part of a complex number
        Specified by:
        getIm in interface INumber
        Returns:
        real part
      • getRe

        public ISignedNumber getRe()
        Returns the real part of a complex number
        Specified by:
        getRe in interface INumber
        Returns:
        real part

SCaVis 2.2 © jWork.ORG