Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/davidedc/Algebrite

Computer Algebra System in Javascript (Typescript)
https://github.com/davidedc/Algebrite

algebra algebraic algebraic-computation cas coffeescript computer-algebra computer-algebra-system javascript javascript-cas math symbolic symbolic-computation symbolic-manipulation

Last synced: 16 days ago
JSON representation

Computer Algebra System in Javascript (Typescript)

Awesome Lists containing this project

README

        

algebrite header

[![npm version](https://badge.fury.io/js/algebrite.svg)](https://badge.fury.io/js/algebrite)

Algebrite is a Javascript (Typescript) library for symbolic mathematics designed to be comprehensible and easily extensible.

```js
var Algebrite = require('algebrite')

Algebrite.run('x + x') // => "2 x"

Algebrite.factor('10!').toString() // => "2^8 3^4 5^2 7"

Algebrite.eval('integral(x^2)').toString() // => "1/3 x^3"

// composing...
Algebrite.integral(Algebrite.eval('x')).toString() // => "1/2 x^2"
```

# Features

Algebrite supports: arbitrary-precision arithmetic, complex quantities, simplification, expansion , substitution, symbolic and numeric roots, units of measurement, matrices, derivatives and gradients, tensors, integrals, multi-integrals, computing integrals and much more!

# Examples and manual

Please refer to [http://algebrite.org/](http://algebrite.org/)

All the built-in methods in Algebrite are exposed through a javascript interface. Strings are automatically parsed as expressions, numbers are converted into the appropriate representation, and the internal cons objects are returned.

The cons objects have a `toString` method which converts it into a pretty-print notation.

# How to build

For a build to run tests:

1. make sure npm is installed, then:
2. ```npm install```
3. ```bazelisk build algebrite```

(```bazelisk``` is the launcher for the ```bazel``` build system). The bazel build system tends to be smart and cache things. You can do a thorough clean by:

```bazelisk clean; rm -rf ./dist/*```

The so called "npm build" does a build for npm and browser:

1. make sure npm is installed, then:
2. ```npm install``` (if you didn't run this already)
3. ```bazelisk build npm```
4. open ```index.html```

# How to test

For full tests:

```bazelisk test :all```

or, if caches get in the way:

```bazelisk test :all --cache_test_results=no```

# Contribute
please take a look at the [contributing](https://github.com/davidedc/Algebrite/blob/master/contributing.md) file.

# References

Algebrite starts as an adaptation of [the EigenMath CAS by George Weigt](http://eigenmath.sourceforge.net/Eigenmath.pdf). Also you might want to check another fork of EigenMath: [SMIB by Philippe Billet](http://smib.sourceforge.net/).

Another CAS of similar nature is [SymPy](http://www.sympy.org/en/index.html) made in Python.

Three other Javascript CAS are

* [javascript-cas by Anthony Foster](https://github.com/aantthony/javascript-cas) supporting "differentiation, complex numbers, sums, vectors (dot products, cross products, gradient/curl etc)"
* [Coffeequate by Matthew Alger](http://coffeequate.readthedocs.org/) supporting "quadratic and linear equations, simplification of most algebraic expressions, uncertainties propagation, substitutions, variables, constants, and symbolic constants".
* [Algebra.js by Nicole White](http://algebra.js.org) which among other things can build and solve equations via a "chainable" API.