예제 #1
0
        public static void Test()
        {
            // Initialize the math solving engine.
            MathSolver.Init();

            EvalData evalData = ConstructEvalData();

            // Object deriving from ExComp representing a algebraic variable.
            AlgebraComp x = new AlgebraComp("x");

            ExComp complexExpression = ConstructEx("3x^2 - 3", evalData);

            ExComp combined = AddOp.StaticCombine(x, complexExpression);

            // Square the expression.
            ExComp squared = PowOp.RaiseToPower(complexExpression, new ExNumber(2.0), ref evalData, false);

            // String containing the evaluated result.
            string result = squared.ToAlgTerm().FinalToDispStr();

            ExComp left = ConstructEx(¨ln(x-2)¨, evalData);
            ExComp right = ConstructEx(¨3¨, evalData);

            // The object containing the functionality used to solve algebraic equations.
            AlgebraSolver agSolver = new AlgebraSolver();

            // Any additional information regarding the result will be stored in the evalData object.
            ExComp solveResult = agSolver.SolveEq(left, right, new AlgebraVar(¨x¨), evalData);
        }
예제 #2
0
        public static void Test()
        {
            // Initialize the math solving engine.
            MathSolver.Init();

            EvalData evalData = ConstructEvalData();

            // Object deriving from ExComp representing a algebraic variable.
            AlgebraComp x = new AlgebraComp("x");

            ExComp complexExpression = ConstructEx("3x^2 - 3", evalData);

            ExComp combined = AddOp.StaticCombine(x, complexExpression);

            // Square the expression.
            ExComp squared = PowOp.RaiseToPower(complexExpression, new ExNumber(2.0), ref evalData, false);

            // String containing the evaluated result.
            string result = squared.ToAlgTerm().FinalToDispStr();

            ExComp left  = ConstructEx(¨ln(x - 2) ¨, evalData);
            ExComp right = ConstructEx(¨3¨, evalData);

            // The object containing the functionality used to solve algebraic equations.
            AlgebraSolver agSolver = new AlgebraSolver();

            // Any additional information regarding the result will be stored in the evalData object.
            ExComp solveResult = agSolver.SolveEq(left, right, new AlgebraVar(¨x¨), evalData);
        }