1.0.8 • Published 3 years ago

polynomial-solver v1.0.8

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Polynomial-Solver

Polynomial Solver is a tool that can calculate real roots and critical points of any real polynomial of any degree, with other interesting features such as calculating the area under the curve, the length of a curve in an interval, and finding the equation of polynomial whose real roots are known.

You can check out this tool here, https://mohammedadnan2307.github.io/Polynomial-Solver/

Calculate Roots

calculateRoots( ) function can be used to calculate real roots of any polynomial. The parameter is a string of simplified polynomial expression. The expression is written as a function of x, f(x). Expression must contain real values and exponents must be non-negative integers only. The output is an array containing value of the roots.

Example:
var polynomialSolver = require("polynomial-solver"); console.log(polynomialSolver.calculateRoots("x^3-6x^2+11x-6")); // Result: 1, 2, 3

Critical Points

calculateCriticalPoints( ) function can be used to calculate critical/turning points of polynomial. The parameter is a string of simplified polynomial expression. The expression is written as a function of x, f(x). Expression must contain real values and exponents must be non-negative integers only. The output is an array containing value of the critical points.

Example:
var polynomialSolver = require("polynomial-solver"); console.log(polynomialSolver.calculateCriticalPoints("x^2-5x+6")); // Result: 2.5

Generate Equation

generateEquation( ) function can be used to find the eqution of polynomial whose real roots are known. The parameter is an array containing the value of roots. The output is a string containing the polynomial expression.

Example:
var polynomialSolver = require("polynomial-solver"); console.log(polynomialSolver.generateEquation(1,2,3)); // Result: "x^3 - 6x^2 + 11x - 6"

Curve Area

curveArea( ) function can be used to calculate the area under curve in an interval. The parameters are string containing polynomial expression (as mentioned above), value of lower limit of the interval, value of higher limit of the interval. The output is a value of the area under curve.

Example:
var polynomialSolver = require("polynomial-solver"); console.log(polynomialSolver.curveArea("x^5 - 3.12x^2 + 6x - 5", -1.5, 2)); // Result: -15.31177

Curve Length

curveLength( ) function can be used to calculate the length curve in an interval. The parameters are string containing polynomial expression (as mentioned above), value of lower limit of the interval, value of higher limit of the interval. The output is a value of the length of curve in an interval. The result obtained is an approximate but not a precise value.

Example:
var polynomialSolver = require("polynomial-solver"); console.log(polynomialSolver.curveLength("x^2 - 5x + 6", -1, 2)); // Result: 12.48885

Derivative

calculateDerivative( ) function can be used to calculate the deriative of any polynomial. The parameter is a string of simplified polynomial expression.
The expression is written as a function of x, f(x). Expression must contain real values and exponents must be non-negative integers only.
The output is a string containing the required derivative.

Example
var polynomialSolver = require("polynomial-solver"); console.log(polynomialSolver.calculateDeriative("x^2 - 5x + 6")); // Result: "2x-5"

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago