Algebra and analysis
The algebra and analysis modules are described in one page per family of classes. Each page explains the classes with examples, then lists their members.
| Page | Classes |
|---|---|
| Numbers | Fraction, Root, Numeric |
| Polynomials | Monom, Polynom, Factor, PolyFactor |
| Equations and solutions | Equation, Solution |
| Matrices and systems | Matrix, PolyMatrix, LinearSystem |
| Intervals, domains and signs | Interval, Domain, TableOfSigns, LogicalSet |
A first example that crosses these modules: a polynomial, its roots, and the sign of its values.
js
const P = new Polynom('x^2-5x+6')
P.factorize().map(f => f.display) // [ 'x-2', 'x-3' ]
new Equation('x^2-5x+6=0').solve().map(s => s.display) // [ '2', '3' ]
new TableOfSigns(P).negative().display // ]2;3[Geometry has its own pages: in the plane and in space.
Rules shared by every class
- Mutating operations.
add,subtract,multiply,divide,pow,reduce... modify the object and return it.clone()keeps the original, and a failing operation leaves the object unchanged. - Output.
.texgives LaTeX and.displaygives plain text. See displaying results. - Permissive and strict types.
Fractionrepresents an invalid or infinite value like a JavaScript number (isNaN(),isFinite()).Root,Monom,Polynomand the other expression types are strict and throw on a malformed input. See errors. - Predicates are methods.
isZero(),isOne(),isEqual(),isSameAs()... are called with parentheses. In untyped JavaScript,obj.isZerowithout them is always truthy.