# stemcmicro

> Computer Algebra System in TypeScript

Latest version **0.9.42** (published 2024-05-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install stemcmicro
pnpm add stemcmicro
yarn add stemcmicro
bun add stemcmicro
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; large bundle; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.42 |
| Published | 2024-05-30 |
| First published | 2024-02-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 14 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | David Geo Holmes |
| Maintainers | geometryzen |
| Keywords | algebrite, algebra, blade, cas, clojurescript, computer, eigenmath, geometric, math, multivector, symbolic, system |

## Links

- npm: https://www.npmjs.com/package/stemcmicro
- Repository: https://github.com/geometryzen/stemcmicro
- Homepage: https://github.com/geometryzen/stemcmicro#readme
- Issues: https://github.com/geometryzen/stemcmicro/issues
- npm.io page: https://npm.io/package/stemcmicro

## Dependencies (2)

- [typhon-lang](https://npm.io/package/typhon-lang.md) ^1.0.13
- [@geometryzen/esprima](https://npm.io/package/@geometryzen/esprima.md) ^0.9.13

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 0.9.42 (latest) — 2024-05-30
- 0.0.269 — 2024-03-06
- 0.0.268 — 2024-03-06
- 0.0.267 — 2024-03-06
- 0.0.266 — 2024-03-05
- 0.0.265 — 2024-03-05
- 0.0.264 — 2024-03-02
- 0.0.263 — 2024-03-02
- 0.0.262 — 2024-03-02
- 0.0.261 — 2024-03-01
- 0.0.260 — 2024-03-01
- 0.0.259 — 2024-03-01
- 0.0.258 — 2024-03-01
- 0.0.257 — 2024-03-01
- 0.0.256 — 2024-03-01
- … 81 more at https://npm.io/package/stemcmicro/versions

## README

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

STEMCmicro is a Javascript (Typescript) library for symbolic mathematics.

## Example

```typescript

import assert from 'assert';
import { is_rat } from "math-expression-atoms";
import { create_engine, ExprEngine } from "../src/api/index";
import { State, Stepper } from '../src/clojurescript/runtime/Interpreter';
import { Stack } from "../src/env/Stack";

describe("example", function () {
    it("program", function () {
        const lines: string[] = [
            `(+ 1 2 3 4 5)`,
            `(+ 10 (* 5 2))`,
            `(* (+ 10 5) 2)`
        ];
        const sourceText = lines.join('\n');
        const engine: ExprEngine = create_engine({ syntaxKind: ... });
        const { program, errors } = engine.parseModule(sourceText, {});
        assert.strictEqual(errors.length, 0);
        const runner = new Stepper(program);
        runner.run();
        const stack: Stack<State> = runner.getStateStack();
        assert.strictEqual(stack.length, 1);
        const values = stack.top.values;
        assert.strictEqual(values.length, 3);
        assert.strictEqual(engine.renderAsString(values[0], { format: 'Infix' }), "15");
        assert.strictEqual(is_rat(values[0]), true);
        assert.strictEqual(engine.renderAsString(values[1], { format: 'Infix' }), "20");
        assert.strictEqual(is_rat(values[1]), true);
        assert.strictEqual(engine.renderAsString(values[2], { format: 'Infix' }), "30");
        assert.strictEqual(is_rat(values[2]), true);
        engine.release();
    });
});```

## Features

* arbitrary-precision arithmetic
* complex quantities
* geometric algebra
* trigonometric functions
* special functions
* simplification
* expansion
* substitution
* factoring
* symbolic and numeric roots
* units of measure
* hyperreal numbers
* matrices
* derivatives and gradients
* tensors
* booleans
* integrals
* multi-integrals
* open for extension

## Getting Started

Please take a look at the [tutorial](https://github.com/geometryzen/stemcmicro/blob/master/TUTORIAL.md) file.

## Contributing

Please take a look at the [contributing](https://github.com/geometryzen/stemcmicro/blob/master/CONTRIBUTING.md) file.

## References

STEMCmicro is a fork of [Algebrite by Davide Della Casa](https://github.com/davidedc/Algebrite).
The fork adds Geometric Algebra, S.I. Units of Measure, and changes the way that expressions are matched and transformed.  

Algebrite started as a port of [the EigenMath CAS by George Weigt](http://eigenmath.sourceforge.net/Eigenmath.pdf) to TypeScript.
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.

---
_Source: https://npm.io/package/stemcmicro · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
