Linear algebra math library for Javascript/Typescript


Keywords
math, linear-algebra, vector, matrix, webgl, typescript
License
MPL-2.0
Install
npm install lamath@3.0.3

Documentation

Logo LAMATH

Build Status Version

Linear Algebra Math Library for Javascript/Typescript

LAMATH is a basic linear algebra library designed to be used with WebGL and Typescript. The library depends on neither of them, so it can be used in any JS/TS project that needs vector math.

Features include:

  • 2D, 3D, and 4D vectors.
  • Matrices of any dimensions n×m. Square matrices, 2×2, 3×3, and 4×4 matrices have their own subtypes.
  • Quaternions.

Performance, simplicity, and generality are the main design goals of the library. Vectors and matrices are defined simply as arrays of numbers, no wrapper objects are used. This minimizes the number of allocations and alleviates GC pressure. If required, it is possible also to reuse the vector/matrix arrays by explicitly specifying the result of the operations.