1.0.5 • Published 7 years ago

polymath v1.0.5

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

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);
1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago