/FloPoly

A practical, root-focused JavaScript polynomial utility library.

Primary LanguageTypeScript

Coverage Status Build Status

The focus is to find real polynomial roots from degree 2 (quadratic) up to about degree 20 as accurately and as fast as possible, e.g.

FloPoly.allRoots([1, -21, 175, -735, 1624, -1764, 720]); //=> [0.9999999999999997, 2.0000000000000013, 2.9999999999999316, 4.000000000000096, 5.000000000000012, 6.000000000000028]

Documentation, Benchmarks and more

Please visit the site.

Installation and Usage

Node (or the browser if you use Browserify)

On the command line

npm install flo-poly

Then, in your project

var Poly = require("flo-poly");

Browser

On the command line

npm install flo-poly

Then, include the script in your project:

<script src='node_modules/flo-poly/browser/index.min.js'></script>

After having included the script file in your HTML there will be a new global viariable available called FloPoly that represents the library. See the docs.