filipemeneses / multi-matrix

Creates N dimensional matrix

Home Page:http://npmjs.com/package/multi-matrix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

multi-matrix

Creates N dimensional matrix


Install

npm i -S multi-matrix
// yarn add multi-matrix

Usage

const { matrix } = require('multi-matrix')

matrix(2).forEach(([x]) => console.log(x));
matrix(2, 2).forEach(([x, y]) => console.log(x, y));
matrix(2, 2, 2).forEach(([x, y, z]) => console.log(x, y, z));
matrix(2, 2, 2, 2).forEach(([x, y, z, n]) => console.log(x, y, z, n));
matrix(2, 2, 2, 2, 2).forEach(([x, y, z, n1, n2]) => console.log(x, y, z, n1, n2));

matrix(2).map(([x]) => ({ x }));
matrix(2, 2).map(([x, y]) => ({ x, y }));
matrix(2, 2, 2).map(([x, y, z]) => ({ x, y, z }));
matrix(2, 2, 2, 2).map(([x, y, z, n]) => ({ x, y, z, n }));
matrix(2, 2, 2, 2, 2).map(([x, y, z, n1, n2]) => ({ x, y, z, n1, n2 }));

About

Creates N dimensional matrix

http://npmjs.com/package/multi-matrix


Languages

Language:JavaScript 100.0%