https://github.com/nicolewhite/algebra.js
Build, display, and solve algebraic equations.
https://github.com/nicolewhite/algebra.js
algebra javascript
Last synced: 3 months ago
JSON representation
Build, display, and solve algebraic equations.
- Host: GitHub
- URL: https://github.com/nicolewhite/algebra.js
- Owner: nicolewhite
- License: mit
- Archived: true
- Created: 2015-05-05T10:37:32.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-05-03T22:43:51.000Z (over 6 years ago)
- Last Synced: 2025-08-29T02:58:04.994Z (4 months ago)
- Topics: algebra, javascript
- Language: JavaScript
- Homepage: http://algebra.js.org
- Size: 529 KB
- Stars: 1,338
- Watchers: 44
- Forks: 109
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-js - AlgebraJS - Build, display, and solve algebraic equations. (Utilities)
README
# algebra.js
[](https://travis-ci.org/nicolewhite/algebra.js)
[](https://coveralls.io/r/nicolewhite/algebra.js?branch=master)
[](http://badge.fury.io/js/algebra.js)
[](https://gitter.im/nicolewhite/algebra.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## Quick Start
```js
var expr = new Expression("x");
expr = expr.subtract(3);
expr = expr.add("x");
console.log(expr.toString());
```
```
2x - 3
```
```js
var eq = new Equation(expr, 4);
console.log(eq.toString());
```
```
2x - 3 = 4
```
```js
var x = eq.solveFor("x");
console.log("x = " + x.toString());
```
```
x = 7/2
```
[Read the full documentation at the project site](http://algebra.js.org).
## Install
### Stable Release
#### In Node
```
npm install algebra.js
```
#### In the Browser
Download [algebra.min.js](http://algebra.js.org/javascripts/algebra-0.2.6.min.js).
### Latest Development Release
```
git clone https://github.com/nicolewhite/algebra.js.git
cd algebra.js
```
#### In Node
```js
var algebra = require("./algebra");
```
#### In the Browser
The following will build `algebra.js` in the `build` directory.
```
make bundle
```
The following will build `algebra.min.js` in the `build` directory.
```
make minify
```