Highlights

Description

JigMath is a real-time equation parser and solver for the web with syntax highlighting capabilities.

Inputs are coordinates, output is a color.

Steps:

  1. The user writes his mathematical expression in the textarea.
  2. The input is parsed, mainly with regular expressions.
  3. The same input is drawn above the textarea to add syntax highlighting and to underline any errors and warnings (unknown function or variable, bad symbol…).
  4. The function is simplified when possible (4*6*x becomes 24*x).
  5. The function is called for each value of the predefined variables (e.g. x and y).

Context

This tool was made for the LED-Cube project of Robotek. And more specifically, to create animations from a function with 4 dimensions.

Creating animations with hundreds of 512-color frames is tedious. With this equation parser, we were able to generate animations in seconds.

About half of the animations here were generated using a formula.

Overview

Blurred sinusoid
lumiere(#FF0000,exp(-abs(cos(x)-y)))
b
Color wheel
huerotate(#FF00000,angle_complexe(y,x))
A RGB color wheel on a rectangular pixelated canvas
Color wheel on LED-Cube
Credits to Robotek
A RGB color wheel on the LED-Cube viewer. Only the two front layers of the LED-Cube are colored.