Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/schteppe/m.js
JavaScript matrix math library that uses typed arrays.
https://github.com/schteppe/m.js
Last synced: about 2 months ago
JSON representation
JavaScript matrix math library that uses typed arrays.
- Host: GitHub
- URL: https://github.com/schteppe/m.js
- Owner: schteppe
- License: other
- Created: 2013-10-15T11:15:59.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-10-15T13:55:31.000Z (about 11 years ago)
- Last Synced: 2024-04-09T18:24:47.402Z (9 months ago)
- Language: JavaScript
- Size: 176 KB
- Stars: 7
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
m.js
====JavaScript matrix math library with numeric algorithms that uses typed arrays.
### Basic ideas
* Use typed arrays (e.g. ```Float32Array```) for matrix data. This enables fast data passing to/from WebWorkers/WebGL.
* Encourage efficient usage patterns through API conventions.### Matrix layout
For a matrix with 3 rows and 4 columns, the data is arranged like this in the array:
```
[ a11, a12, a13, a14,
a21, a22, a23, a24
a31, a32, a33, a34 ]
```### Example
```js
var A = m.create(3,3); // Create 3x3 matrix
var b = m.create(3,1); // Create 1D column vector of length 3
m.identity(A); // Set matrix A to identity
m.ones(b); // Set all elements in b to 1
var x = m.cholsolve(A,b); // Solve system A*x=b using cholesky factorization
```