Algebra.js is a JavaScript library designed for building, displaying, and solving algebraic equations. As of version 0.2.6, it provides core functionalities for creating `Fraction` objects for precise arithmetic, `Expression` objects to represent algebraic expressions, and `Equation` objects to encapsulate equalities. A key differentiator is its ability to parse string representations of expressions and equations, enabling convenient construction from human-readable input. The library also includes methods for symbolic simplification, evaluation, and solving linear, quadratic, cubic, and quartic equations, along with a `toTex()` method for LaTeX output. It primarily targets Node.js and browser environments using CommonJS module syntax. The release cadence is infrequent, with recent updates focusing on bug fixes and stability within the 0.2.x series.
npm install algebra.jsVerified import paths — ran on the pinned version, not inferred.
Demonstrates creating expressions, equations, displaying them, solving for a variable, and using the string parser.
Update to version 0.2.0 or later and adjust logic to handle `Fraction(1, 1)` instead of `undefined` for infinite solutions.
Upgrade to version 0.2.4 or newer to ensure correct solving of quadratic equations under these conditions.
Upgrade to version 0.2.2 or newer to benefit from improved parser robustness and correct interpretation of negative numbers and adjacent parentheses.
Update to version 0.2.1 or later to ensure `Expression.simplify()` consistently reduces expressions to their single simplest constant form.
No dependency data recorded yet.