GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing mathparser.org — Solving equation f(x) = 0 - mXparser - Math Expressions Parser for JAVA, C#, C++, Kotlin, Android, .NET/MONO/Xamarin - Mathematical Formula Parser / Evaluator Library FOR COMMERCIAL USE, PLEASE ENSURE YOU HAVE A COMMERCIAL LICENSE.ANOTHER WAY TO SUPPORT MY WORK IS BY PURCHASING MY BOOK, CUSTOMER FIRST, VALUE NEXT.THANK YOU FOR SUPPORTING MY WORK!The tutorial consists of more than 200 live examples from 50 sections given separately for JAVA, C# and C++. Each of the examples can be copied and run on your own environment. In addition, mXparser provides an extensive collection of over 500 built-in math functions, expressions and symbols. Familiarize yourself with the scope and the syntax. Live testing is the best way to learn. Good luck! 🙂Tutorial Math Collection API spec Download Below is the code for JAVA, C# (the code for C# is almost identical) and C++. To copy the code, double-click inside the frame.Case 1: Solve 2x-4 = 0 for x in [0, 10]Java/C# code// JAVA: import org.mariuszgromada.math.mxparser.*;
// C#: using org.mariuszgromada.math.mxparser;
// ...
Expression e = new Expression("solve( 2*x - 4, x, 0, 10 )");
mXparser.consolePrintln("Res: " + e.getExpressionString() + " = " + e.calculate() );
C++ code#include "org/mariuszgromada/math/mxparser.hpp"
// ...
ExpressionPtr e = new_Expression("solve( 2*x - 4, x, 0, 10 )");
mXparser::consolePrintln("Res: " + e->getExpressionString() + " = " + e->calculate() );
Code result[mXparser-v.5.2.1] Res: solve( 2*x - 4, x, 0, 10 ) = 2.0 Case 2: Solve cos(x) = 0 for x in [0, pi]Java/C# code// JAVA: import org.mariuszgromada.math.mxparser.*;
// C#: using org.mariuszgromada.math.mxparser;
// ...
Expression e = new Expression("solve( cos(x), x, 0, pi )");
mXparser.consolePrintln("Res: " + e.getExpressionString() + " = " + e.calculate() );
C++ code#include "org/mariuszgromada/math/mxparser.hpp"
// ...
ExpressionPtr e = new_Expression("solve( cos(x), x, 0, pi )");
mXparser::consolePrintln("Res: " + e->getExpressionString() + " = " + e->calculate() );
Code result[mXparser-v.5.2.1] Res: solve( cos(x), x, 0, pi ) = 1.57079633 Case 3: Solve cos(x) = 0 for x in [pi, pi] (root not bracketed)Java/C# code// JAVA: import org.mariuszgromada.math.mxparser.*;
// C#: using org.mariuszgromada.math.mxparser;
// ...
Expression e = new Expression("solve( cos(x), x, -pi, pi )");
mXparser.consolePrintln("Res: " + e.getExpressionString() + " = " + e.calculate() );
C++ code#include "org/mariuszgromada/math/mxparser.hpp"
// ...
ExpressionPtr e = new_Expression("solve( cos(x), x, -pi, pi )");
mXparser::consolePrintln("Res: " + e->getExpressionString() + " = " + e->calculate() );
Code result[mXparser-v.5.2.1] Res: solve( cos(x), x, -pi, pi ) = -1.57079633 Case 4: Solve x-y = 0 for x in [0, 10] and y = 4Java/C# code// JAVA: import org.mariuszgromada.math.mxparser.*;
// C#: using org.mariuszgromada.math.mxparser;
// ...
Argument y = new Argument("y = 4");
Expression e = new Expression("solve( x-y, x, 0, 10 )", y);
mXparser.consolePrintln("Res: " + e.getExpressionString() + " = " + e.calculate() );
C++ code#include "org/mariuszgromada/math/mxparser.hpp"
// ...
ArgumentPtr y = new_Argument("y = 4");
ExpressionPtr e = new_Expression("solve( x-y, x, 0, 10 )", y);
mXparser::consolePrintln("Res: " + e->getExpressionString() + " = " + e->calculate() );
Code result[mXparser-v.5.2.1] Res: solve( x-y, x, 0, 10 ) = 4.0 Case 5: Solve sin'(x) = 0 for x in [0, pi]Java/C# code// JAVA: import org.mariuszgromada.math.mxparser.*;
// C#: using org.mariuszgromada.math.mxparser;
// ...
Argument x = new Argument("x");
Expression e = new Expression("solve( der( sin(x), x ), x, 0, pi )", x);
mXparser.consolePrintln("Res: " + e.getExpressionString() + " = " + e.calculate() );
C++ code#include "org/mariuszgromada/math/mxparser.hpp"
// ...
ArgumentPtr x = new_Argument("x");
ExpressionPtr e = new_Expression("solve( der( sin(x), x ), x, 0, pi )", x);
mXparser::consolePrintln("Res: " + e->getExpressionString() + " = " + e->calculate() );
Code result[mXparser-v.5.2.1] Res: solve( der( sin(x), x ), x, 0, pi ) = 1.57079633 Nuget – Package Manager (C#, F#, Visual Basic, …)
Maven – Dependency (Java, Kotlin, Scala, Groovy, …)
Maven – Gradle
CMake – Dependency / FetchContent (C++, MSVC, LLVM/Clang, GNU/GCC, MinGW, MSYS2, WSL, Windows, Linux, Unix, MacOS)
GitHub
OTHER DOWNLOAD OPTIONSDownload latest release – v.6.1.0 Sagitara: .NET bin onlyDownload latest release – v.6.1.0 Sagitara: JAVA bin onlyDownload latest release – v.6.1.0 Sagitara: bin + doc NEWS FROM MATHPARSER.ORGSOURCE CODESource code .zipSource code .tar.gz My other creative spacesDONATIONDonation with PayPal |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |