Ramda-based library for working with matrices in JavaScript
MIT License
Ramda-based library for working with matrices in JavaScript
Install this package:
npm i ramda-matrix
Import the library into your script:
import * as M from 'ramda-matrix';
Start hacking!
const A = M.parse`
1 2/3 3
-1 2 3
`;
console.table(M.matrixByMatrix(A, A));
Documentation is located in src/index.ts
parse
)sum
, diff
)transpose
)matrixByScalar
,matrixByVector
, matrixByMatrix
)equal
, isIdentity
)identity
, traverse
, fill
)NOTE: you can print any matrix by calling console.table
:
console.table(A);
NOTE: JavaScript is infamous for floating point rounding errors. Most of them can be metigated by rounding each cell, like this:
parseInt(cell.toFixed('3'));
Status indicators:
b
) signifies a breaking changei
) signifies change of behaviour for existing functionsparse
returning NaN when line contains whitespaces at thei
)markowChain
functionrotationMatrix
functionparse
support floating-point numbers and fractions (i
)b
)rotate
function (b
)det
work with any matrixrref
functioninverse
functionrotate
functionreflect
function?identity
accept single argument