Node Quadratic
In algebra, a quadratic function, a quadratic polynomial, a polynomial of degree 2, or simply a quadratic, is a polynomial function in one or more variables in which the highest-degree term is of the second degree.
Installation
This is a Node.js module available through the npm registry.
Before installing nodequadratic
, download and install Node.js
Installation is accomplished using the npm install command:
$ npm i nodequadratic --save
Usage
Node Quadratic is a very simple package to use:
var nodequadratic = ; // var result = nodequadratic.solve(a, b, c); var result = nodequadratic; console; /* { discriminant: 256, solutions: { plus: 14, minus: -2 }} */ console; // The roots are 14 and -2
The plus and minus solutions are a result of subtracting or adding the discriminant from -b before dividing by 2a.
console; // 14