/glam

Complex Analysis graphing calculator

Primary LanguageC++Apache License 2.0Apache-2.0

Glam

Glam is a web-based graphing calculator for complex numbers and functions. It prioritizes speed and ease of use, which means that it should be accessible to any mathematics student without coding experience.

Building

The core module is built using cmake with an emscripten toolchain, and the UI module is built using npm and typescript. The process has been tested on 64-bit Linux and will likely need to be modified if you use Windows.

Dependencies

  • emscripten - most easily installed using the emsdk tool. Follow the instructions to install the latest toolchain.
  • binaryen is included as a git submodule, so make sure to update with git submodule update --init before continuing.
  • Make sure the following environment variables are set:
# for an example install directory
# most of these should be set using the script in the emsdk folder.
EMSDK=/home/user/emsdk
EM_CONFIG=/home/user/emsdk/.emscripten
EMSDK_NODE=/home/user/emsdk/node/14.15.5_64bit/bin/node
BINARYEN_ROOT=/home/user/emsdk/binaryen/main_64bit_binaryen
  • mathquill is also included as a git submodule. After updating submodules, use the buildMathquill.sh script to compile it.

Core Dependencies

The core module has several dependencies that must be built locally.

  1. Navigate to core/ and make a build directory (mkdir build),
  2. cd ./build && emcmake cmake ..
  3. Build mpc and its dependencies:
cmake -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake --build . --target mpc -- -j N # where `N` is the number of cores to use.
  1. Build binaryen:
        cd local/src/binaryen # a git submodule
        emcmake cmake -DBUILD_STATIC_LIB=ON
        emmake make -j N # same thing, N is the number of cores.
        # this command might fail - it's okay as long as it succeeds building libbinaryen.a.

Core Module

  1. cd build/
  2. emmake make glamcore -j N
  3. make install (copies the compiled wasm into the source tree for the UI module)

UI Module

  1. Navigate to the ui directory
  2. Configure the project. I use yarn, so running yarn in this directory suffices.

To run a local development server, run yarn start. To make a production build, use yarn build.

Acknowledgements

An older version of Glam bundled the asciimath2tex library, created by Christian Lawson-Perfect, available here. It is licensed under the Apache License 2.0.