src/Matrix.php
public function transpose() {
        $cpy = new static();
        $cpy->copy($this);

        for ($i=0; $i<static::ROWS; $i++) {
            for ($j=0; $j<static::COLUMNS; $j++) {
                $this[$i][$j] = $cpy[$j][$i];
            }
        }

    }
public function transpose() {
        $cpy = new static();
        $cpy->copy($this);

        for ($i=0; $i<static::ROWS; $i++) {
            for ($j=0; $j<static::COLUMNS; $j++) {
                $this[$i][$j] = $cpy[$j][$i];
            }
        }

    }
public function transpose ( ) { $ cpy = new static ( ) ; $ cpy -> copy ( $ this ) ; for ( $ i = 0 ; $ i < static :: ROWS ; $ i ++ ) { for ( $ j = 0 ; $ j < static :: COLUMNS ; $ j ++ ) { $ this [ $ i ] [ $ j ] = $ cpy [ $ j ] [ $ i ] ; } } }
Transpose the matrix.
Transpose the matrix .