https://github.com/remigius42/algebra.ts
Build, display, and solve algebraic equations.
https://github.com/remigius42/algebra.ts
algebra equations expressions fractions inequations latex math solver typescript
Last synced: 4 months ago
JSON representation
Build, display, and solve algebraic equations.
- Host: GitHub
- URL: https://github.com/remigius42/algebra.ts
- Owner: remigius42
- License: mit
- Created: 2024-03-11T16:29:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-14T13:58:12.000Z (over 2 years ago)
- Last Synced: 2025-08-20T01:41:52.587Z (11 months ago)
- Topics: algebra, equations, expressions, fractions, inequations, latex, math, solver, typescript
- Language: TypeScript
- Homepage: https://remigius42.github.io/algebra.ts/
- Size: 913 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# algebra.ts
Copyright 2024 binary poetry gmbh
[](./LICENSE)
[](https://github.com/remigius42/algebra.ts/actions/workflows/node.js.yml)

[](https://coveralls.io/r/remigius42/algebra.ts?branch=main)
`algebra.ts` lets you build, display and solve algebraic equations in TypeScript
and JavaScript.
It's a fork of [algebra.js](https://github.com/nicolewhite/algebra.js) created
by [Nicole White](https://github.com/nicolewhite/) and you can find the original
copyright and license file in [LICENSE_algebra-js](./LICENSE_algebra-js).
## Quick Start
This section gives a brief example on how to use the library. The library is
assumed to be in the same directory as the HTML page containing the snippet.
Alternatively you could load the library via a content delivery network (CDN),
for example
.
Please refer to the [full
documentation](https://remigius42.github.io/algebra.ts/) for further information
and live examples.
### Using ES Modules
```html
import { Expression, Equation } from "algebra-x.y.z.esm.min.js"
const expr = new Expression("x")
expr = expr.subtract(3)
expr = expr.add("x")
console.log(String(expr)) // 2x - 3
const eq = new Equation(expr, 4)
console.log(String(eq)) // 2x - 3 = 4
const x = eq.solveFor("x")
console.log("x = " + String(x)) // x = 7/2
```
### Using the UMD version
```html
const expr = new algebra.Expression("x")
expr = expr.subtract(3)
expr = expr.add("x")
console.log(String(expr)) // 2x - 3
const eq = new algebra.Equation(expr, 4)
console.log(String(eq)) // 2x - 3 = 4
const x = eq.solveFor("x")
console.log("x = " + String(x)) // x = 7/2
```
## Contributing
Thanks for your interest in contributing! There are many ways to contribute to
this project. Get started by having a look at
[CONTRIBUTING.md](./CONTRIBUTING.md).
## Funding
This project is powered by coffee, therefore I would appreciate if you could
thank you!
