@cortex-js/math-json
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published
math live

Cortex Compute Engine

Symbolic manipulation and numeric evaluation of MathJSON expressions

MathJSON is a lightweight data interchange format for mathematical notation, based on JSON.

The Cortex Compute Engine can parse Latex to MathJSON, serialize MathJSON to Latex, format, simplify and evaluate MathJSON expressions.

Reference documentation and guides at cortexjs.io/compute-engine.

Using Compute Engine

$ npm install --save @cortex-js/compute-engine
import { parse, evaluate } from '@cortex-js/compute-engine';

const expr = parse('2^{11}-1 \\in \\P');

console.log(expr);
// ➔ ["Element", ["Subtract", ["Power", 2, 11] , 1], "PrimeNumber"]

console.log(evaluate(expr));
// ➔ "False"

More

Related Projects

MathJSON
A lightweight data interchange format for mathematical notation
MathLive (on GitHub)
A Web Component for math input.
Cortex (on GitHub)
A programming language for scientific computing

Support the Project

License

This project is licensed under the MIT License.

Package Sidebar

Install

npm i @cortex-js/math-json

Weekly Downloads

168

Version

0.3.0

License

MIT

Unpacked Size

1.9 MB

Total Files

40

Last publish

Collaborators

  • arnog