I am looking for a simple computer algebra system (cas) for JavaScript but I can't find anything with google. I only need basic functionality:
Do you know of such a library?
There is a list of more than 7 other CAS libraries for JS at the bottom of their website. Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question.
Polynomial.js by Robert Eisele specifically performs operations on polynomials in the fields: Q, C, Zp and R. (roots/factorisation routines not included). Kas by the Khan Academy's team can simplify and compare expressions and equations.
javascript-cas by Anthony Foster supporting "differentiation, complex numbers, sums, vectors (dot products, cross products, gradient/curl etc)" Coffeequate by Matthew Alger supporting "quadratic and linear equations, simplification of most algebraic expressions, uncertainties propagation, substitutions, variables, constants, and symbolic constants"
(I'm answering myself, as the bounty failed to bring attention on this.)
You might want to try this CAS, which has some good functions (although some parts are broken, use the older versions).
You can try nerdamer
//Expanding
var result = nerdamer('a*(x+y)',null,'expand');
document.getElementById('text').innerHTML = '<p>'+result.text()+'</p>';
//Solving equation
var sol = nerdamer.solveEquations('0=x^2+x+a','x');
document.getElementById('text').innerHTML += '<p>'+sol.toString()+'</p>';
<script src="http://nerdamer.com/js/nerdamer.core.js"></script>
<script src="http://nerdamer.com/js/Algebra.js"></script>
<script src="http://nerdamer.com/js/Solve.js"></script>
<div id="text"></div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With