polymath

1.0.5 • Public • Published

POLYMATH

GETTING STARTED

Installing with NPM

$ npm install polymath

Browser

<script src="node_modules/polymath/bundles/polymath.js"></script>
<script>
    console.log(polymath.parse("2x^3 + 4x^2 - 3x + 12"));
</script> 

Node

const polymath = require('polymath');
let polynomial = polymath.parse("2x^3 + 4x^2 - 3x + 12");

USAGE

CONSTRUCTION

From a String: polymath.parse('2x^3 + 7x^2 - 3x + 2')

Parsing is done using a parsing expression grammar. See PEG.js

BASIC ARITHMETIC

Polynomial.add(poly: Polynomial): Polynomial

Polynomial.substract(poly: Polynomial): Polynomial

Polynomial.multiply(poly: Polynomial): Polynomial

Polynomial.divide(poly: Polynomial): Polynomial

OTHER FUNCTIONS

Polynomial.toLatex(): string

returns a LaTex representation of the polynomial

Polynomial.iterator(): object

returns an iterator of the monomial terms

ADDITIONAL MODULES

Descarte's Rule of Signs

polymath.ruleOfSigns(poly: Polynomial);

Rational Zeros Test

polymath.rationalZeros(poly: Polynomial);

Synthetic Division

polymath.syntheticDivide(divisor: Polynomial, dividend: Polynomial);

Readme

Keywords

none

Package Sidebar

Install

npm i polymath

Weekly Downloads

0

Version

1.0.5

License

ISC

Last publish

Collaborators

  • chrisrocco