Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tohrxyz/matrices
Hobby educational implementation of matrix operations in TypeScript
https://github.com/tohrxyz/matrices
matrix matrix-multiplication typescript
Last synced: 1 day ago
JSON representation
Hobby educational implementation of matrix operations in TypeScript
- Host: GitHub
- URL: https://github.com/tohrxyz/matrices
- Owner: tohrxyz
- Created: 2023-10-15T19:37:41.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-15T20:12:41.000Z (about 1 year ago)
- Last Synced: 2023-10-16T17:59:15.304Z (about 1 year ago)
- Topics: matrix, matrix-multiplication, typescript
- Language: TypeScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# matrices
Hobby educational implementation of matrix operations in TypeScript (I was bored and curious)# How to use
Install node modules
```sh
$ npm install
```## Matrix Multiplication
To use matrix multiplication program, you need to pass numbers through CLI arguments.Currently only `2x2 * 2x2` is supported.
```sh
$ npx ts-node matrixMultiply.ts 23 42 54 23 51 95 23 58
```
This is equivalent of two matrices as follows:`matrix 1` =
[23, 42],
[54, 23]`matrix 2` =
[51, 96],
[23, 58]### Example output
```sh
first matrix: [ [ 23, 42 ], [ 54, 23 ] ]
second matrix: [ [ 51, 95 ], [ 23, 58 ] ]multiplied matrix: [ [ 2139 ], [ 4621 ], [ 3283 ], [ 6464 ] ]
in 1180167 nanoseconds (~1 milliseconds)
```