https://github.com/h2non/vetrix.js
Turns a vector into a matrix
https://github.com/h2non/vetrix.js
Last synced: 3 months ago
JSON representation
Turns a vector into a matrix
- Host: GitHub
- URL: https://github.com/h2non/vetrix.js
- Owner: h2non
- License: mit
- Created: 2016-02-04T09:59:20.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-04T10:01:43.000Z (almost 10 years ago)
- Last Synced: 2024-10-18T11:25:56.605Z (about 1 year ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vetrix.js
> Converts a vector into a matrix
## Install
`$ npm install vetrix`
## Usage
`vetrix(vector, columns)`
## Examples
```JS
var vetrix = require('vetrix');
var a = [1,2,3,4,5,6,7,8,9];
var b = vetrix(a, 3);
// b = [[1,2,3],[4,5,6],[7,8,9]]
```
```JS
var vetrix = require('vetrix');
var a = [1,2,3,4,5];
var b = vetrix(a, 2);
// b = [[1,2],[3,4],[5]]
```