Exemple #1
0
        internal override Algebraic SymEval(Algebraic x, Algebraic y)
        {
            if (y is Complex && !y.IsComplex() && x is Complex && !x.IsComplex())
            {
                return(new Complex(Math.atan2((( Complex )y).Re, (( Complex )x).Re)));
            }

            if (Symbol.ZERO != x)
            {
                return(FunctionVariable.Create("atan", y / x) + FunctionVariable.Create("sign", y) * (Symbol.ONE - FunctionVariable.Create("sign", x)) * Symbol.PI / Symbol.TWO);
            }
            else
            {
                return((FunctionVariable.Create("sign", y) * Symbol.PI) / Symbol.TWO);
            }
        }