levirs565 / compute-engine

An engine for symbolic manipulation and numeric evaluation of math formulas expressed with MathJSON

Home Page:https://cortexjs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

An engine for symbolic manipulation and numeric evaluation of math formulas expressed with MathJSON

https://cortexjs.io

License:MIT License


Languages

Language:TypeScript 93.2%Language:HTML 3.1%Language:JavaScript 2.1%Language:Shell 1.0%Language:CSS 0.5%