module/src/matrix.js
/**
     * Create a new matrix that is the transpose of the current matrix.
     * @return {Matrix}
     */
Create a new matrix that is the transpose of the current matrix.
@return {Matrix}
Create a new matrix that is the transpose of the current matrix . @return { Matrix }
transpose() {
        const data = new Array(this.columns);
        for (let i = 0; i < this.columns; i++) {
            data[i] = new Array(this.rows - 1);
            for (let j = this.rows - 1; j > -1; j--) {
                data[i][j] = this.data[j][i];
            }
        }
        return new Matrix(this.columns, this.rows, data);
    }
transpose ( ) { const data = new Array ( this . columns ) ; for ( let i = 0 ; i < this . columns ; i ++ ) { data [ i ] = new Array ( this . rows - 1 ) ; for ( let j = this . rows - 1 ; j > - 1 ; j -- ) { data [ i ] [ j ] = this . data [ j ] [ i ] ; } } return new Matrix ( this . columns , this . rows , data ) ; }
Create a new matrix that is the transpose of the current matrix.
Create a new matrix that is the transpose of the current matrix .