Beispiel #1
0
        public Expression InvertOn(Expression other)
        {
            //When right is 2, the invert is sqrt. x^2 -> sqrt[other], -sqrt[other]
            if (Right.CompareTo(Constant.Two))
            {
                var args = new List();
                args.Items.Add(other);

                var answer1 = SysFunc.MakeFunction(args, new Scope(), "sqrt");
                var answer2 = new Minus();
                answer2.Child = answer1;
                var answers = new List();

                answers.Items.Add(answer1);
                answers.Items.Add(answer2);
                return(answers);
            }

            //Couln't InvertOn.
            return(null);
        }