Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
/ LissaJS Public archive

An algebra parsing, evaluation and simplification system written entirely in JavaScript.

Notifications You must be signed in to change notification settings


Folders and files

Last commit message
Last commit date

Latest commit



19 Commits

Repository files navigation


A library for parsing, evaluating and rearranging algebraic expressions in JavaScript.

This project is no longer maintained. Development continues in [](the main Numbas repository).

The name "LissaJS" was picked without much thought. It's meant to pun on "Lissajous", and follows the convention that every Javascript library's name ends in "JS", but apart from that it hasn't got much going for it. Suggestions of better names are welcome at issue #1.

This is a spin-off of the Numbas e-assessment system. It has no external dependencies.

It's currently provided on a "do what you can with it" basis; we'll add examples and documentation later.


There's an interactive demo page at

Installing LissaJS

Include the lissajs.js script in your page.

<script src="lissajs.js"></script>

It uses some ECMAScript 5 features. For older browsers, you'll also need to load es5-shim.

Using LissaJS

There is an explanation of the syntax, data types supported, and a function reference at Just replace Numbas with LissaJS. For more in-depth code documentation, see - again replacing Numbas with LissaJS.

All operations happen with respect to a LissaJS.jme.Scope object. There's a default scope at LissaJS.jme.builtinScope containing all the built-in functions and rulesets. A few of the most commonly-used functions are available through the LissaJS object, using this default scope implicitly, for your convenience.

To evaluate an expression:

LissaJS.evaluate('expression',{dict of variables});

or, with a custom scope:

scope.evaluate('expression',{dict of variables});

To compile an expression to a syntax tree:


To convert an expression to LaTeX:


or, with a custom scope:


To simplify (rearrange) an expression:


or, with a custom scope:


There are lots of pure maths functions under LissaJS.math.


LissaJS uses code from the Numbas project.

Copyright 2011-16 Newcastle University

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

You can see a plain-English explanation of the license and what it allows at tl;drLegal


An algebra parsing, evaluation and simplification system written entirely in JavaScript.







No releases published