EMath++
Classes for mathematical concepts
|
This is a project that aims to provide some wrapper classes for algebraic mathematical concepts.
It includes the Monomial and Polynomial classes for general calculus, plus a Parser for transforming std::string to Polynomial objects.
It also comes with a Termial interface for doing multiple operatios with polynomials: arithemtic, root finding, graphical representation.
The library is currently in expansion. It will include in the future support for Exponential, Trigonometric and Radical functions.
Any feedback is much appreciated!
The project comes with a folder with some bash files that complete some Meson related tasks.
All bash files must be executed from the project's root directory to work properly.
To install the project, it is only necessary to execute two files.
Once installed, just include the emath.h or eparser.h header files in your code as needed, and link them with their implementation.
To setup the Meson project run the setup.sh bash file:
To install the emath library run the install.sh bash file:
The project comes with some test files located in the test folder.
To test that the library code works properly run the following bash file:
The project comes with a folder with some bash files that complete some Meson related tasks.
All bash files must be executed from the project's root directory to work properly.
There are two ways to install the Interface, when following the Library Installation instructions or manually as explained here:
To setup the Meson project run the setup.sh bash file:
To compile the Interface run the compile.sh bash file:
To finish installing the Interface choose one of the two executable files: emath_cli_d or emath_cli_s. The executable ending in _d is the dynamic version and the one ending in _s is the static version.
To launch the Interface just open a console and cd to the directory with the binaries:
Or if they are in the PATH environment variable call them normally:
To add polynomials to the cache and consecuently be able to operate with them you should press 'e' on the main menu. Then you should write the polynomial in the following markup [ 3/2x^2 + 2*2.2x - 5 ] and press enter.
To remove polynomials from the cache and consecuently delete them you should press 'q' on the main menu. Then you should write the number corresponding to the polynomial's index.
Once at least one polynomial has been added you can press space on the main menu to enter to the operation menu:
Now you have a variety of choices: numbered different operations and arithmetic operations.
Once in the operation menu, you can press space again to input a arithmetic operation. Arithmetic operations consist of +, -, *, / operations beetwen the polynomial indexes. Here is an example of what you would input to multiply the polynomial with index 0 to the one with index 1 and add to that what results the polynomial with index 2: [ 0 * 1 + 2 ]. Then the results will be printed, and you will ahve to press any key to continue.
To get the value of y for some x, you make a evaluate operation. Press 1 on the operation menu, input the polynomial's index and then input the x's value.
Both these operations are done in an indentical way: Press 2 or 3 respectively on the operation menu and then input the polynomial's index.
To find the real and complex roots of a polynomial when on the operation menu: Press 4 and then input the polynomial's index. The roots will be printed inside parenthesis.
To draw a polynomial in the Cartesian plane: Press 5 on the operation menu and then input the polynomial's index. A new window will open showing the polynomail on the Cartesian plane. You then can move with the arrow keys around the Cartesian plane and resize the window to expand the Cartesian plane.