Examples of variable()


Examples of jmathexpr.arithmetic.equation.Equation.variable()

        ExpressionParser parser = new ExpressionParser();
//        Expression test = parser.parse("x^2 - 5x");
//        Logger.dump(test);
//        System.exit(-1);
        Equation quad = (Equation) parser.parse("x^2 - 5x + 3 = 0");
        Variable x = quad.variable();
        System.out.printf("%s : %s = ?%n", quad, x);

        Set roots = quad.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
View Full Code Here

Examples of jmathexpr.arithmetic.equation.Equation.variable()

    @Test(dependsOnMethods = { "quadraticFormula" })
    public void anotherQuadratic() throws EquationSolveException {
        ExpressionParser parser = new ExpressionParser();
        Equation quad = (Equation) parser.parse("-x^2 + 6x - 8 = 3x + 7");
        Variable x = quad.variable();
        System.out.printf("%s : %s = ?%n", quad, x);
       
        Set roots = quad.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
View Full Code Here

Examples of jmathexpr.arithmetic.equation.Equation.variable()

    @Test(dependsOnMethods = { "quadraticFormula" })
    public void third() throws EquationSolveException {
        ExpressionParser parser = new ExpressionParser();
//        Equation quad = (Equation) parser.parse("2x^2 - x - 1 = 0");
        Equation quad = (Equation) parser.parse("2*x^2 - x - 1 = 0");
        Variable x = quad.variable();
        System.out.printf("%s : %s = ?%n", quad, x);

        Set roots = quad.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
View Full Code Here

Examples of jmathexpr.arithmetic.equation.Equation.variable()

    @Test(dependsOnMethods = { "third" })
    public void fraction() throws EquationSolveException {
        ExpressionParser parser = new ExpressionParser();
//        Equation quad = (Equation) parser.parse("1/2 x^2 - 16x = 5");
        Equation quad = (Equation) parser.parse("1/2*x^2 - 16x = 5");
        Variable x = quad.variable();
        System.out.printf("%s : %s = ?%n", quad, x);

        Set roots = quad.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
View Full Code Here

Examples of jmathexpr.arithmetic.equation.Equation.variable()

    @Test(dependsOnMethods = { "fraction" })
    public void irrational() throws EquationSolveException {
        ExpressionParser parser = new ExpressionParser();
//        Equation quad = (Equation) parser.parse("sqrt(3) x^2 + sqrt(5) x = 12");
        Equation quad = (Equation) parser.parse("sqrt(3)*x^2 + sqrt(5) x = 12");
        Variable x = quad.variable();
        System.out.printf("%s : %s = ?%n", quad, x);

        Set roots = quad.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
View Full Code Here

Examples of jmathexpr.arithmetic.equation.Equation.variable()

    }

    @Test
    public void oneRadical() throws EquationSolveException {
        Equation req = (Equation) new ExpressionParser().parse("sqrt(x - 8) = 3");
        Variable x = req.variable();
        System.out.printf("%s : %s = ?%n", req, x);
       
        Set roots = req.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
View Full Code Here

Examples of jmathexpr.arithmetic.equation.Equation.variable()

    }

    @Test(dependsOnMethods = { "oneRadical" })
    public void toIsolate() throws EquationSolveException {
        Equation req = (Equation) new ExpressionParser().parse("sqrt(x - 10) - 4 = 0");
        Variable x = req.variable();
        System.out.printf("%s : %s = ?%n", req, x);
       
        Set roots = req.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
View Full Code Here

Examples of jmathexpr.arithmetic.equation.Equation.variable()

    }

    @Test(dependsOnMethods = { "toIsolate" })
    public void radicalAndLinear() throws EquationSolveException {
        Equation req = (Equation) new ExpressionParser().parse("sqrt(x + 1) - 3x = 1");
        Variable x = req.variable();
        System.out.printf("%s : %s = ?%n", req, x);
       
        Set roots = req.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
View Full Code Here

Examples of jmathexpr.arithmetic.equation.Equation.variable()

    }

    @Test(dependsOnMethods = { "radicalAndLinear" })
    public void twoRadicals() throws EquationSolveException {
        Equation req = (Equation) new ExpressionParser().parse("sqrt(x) + sqrt(x - 5) = 1");
        Variable x = req.variable();
        System.out.printf("%s : %s = ?%n", req, x);
       
        Set roots = req.solve();
        System.out.printf("  %s = %s%n", x, roots);
       
View Full Code Here

Examples of jmathexpr.arithmetic.equation.Equation.variable()

    }

    @Test(dependsOnMethods = { "twoRadicals" })
    public void threeRadicals() throws EquationSolveException {
        Equation req = (Equation) new ExpressionParser().parse("sqrt(x + 8) + sqrt(x + 15) = sqrt(9x + 40)");
        Variable x = req.variable();
        System.out.printf("%s : %s = ?%n", req, x);
       
        Set roots = req.solve();
        System.out.printf("  %s = %s%n", x, roots);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.