Home > @josh-brown/vector > MatrixBuilder > fromColumnVectors
Builds a matrix from an array of column vectors
Signature:
fromColumnVectors(columns: Vector<S>[]): M;
Parameter | Type | Description |
---|---|---|
columns | Vector<S>[] | The vectors to use as the columns of the new matrix |
Returns:
M
const firstColumn = vectorBuilder.fromArray([ 1, 2, 3 ]);
const secondColumn = vectorBuilder.fromArray([ 4, 5, 6 ]);
const matrix = matrixBuilder.fromColumnVectors([ firstColumn, secondColumn ]);
// [ 1 4 ]
// [ 2 5 ]
// [ 3 6 ]