A JavaScript utility library for working with mathematical matrices

npm install matrixjs
6 downloads in the last week
7 downloads in the last month



Matrix.js is a JavaScript utility library for working with matrices). It currently supports:

  • Adding matrices
  • Subtracting matrices
  • Multiplying matrices
  • Finding the determinant of a n by n matrix
  • Creating a n by n identity matrix
  • Raising a n by n matrix to the xth power
  • Multiplying each element in the matrix by a scalar

For more information, see the docs.


Patches welcome, just make sure there are matching unit tests. Tests use mocha with expect.js. One particular feature that still needs to be implemented is finding the inverse of a matrix. I have an implementation that can invert either a 2 by 2 or a 3 by 3 matrix, but I am still looking for how to invert a n by n matrix.

npm loves you