public static function transpose(Matrix $matrix)
    {
        $grid = call_user_func_array(
            'array_map',
            array_merge(
                [null],
                $matrix->toArray()
            )
        );

        return new Matrix($grid);
    }
public static function transpose(Matrix $matrix)
    {
        $grid = call_user_func_array(
            'array_map',
            array_merge(
                [null],
                $matrix->toArray()
            )
        );

        return new Matrix($grid);
    }
public static function transpose ( Matrix $ matrix ) { $ grid = call_user_func_array ( 'array_map' , array_merge ( [ null ] , $ matrix -> toArray ( ) ) ) ; return new Matrix ( $ grid ) ; }
Return the transpose of this matrix

@param Matrix $matrix The matrix whose transpose we wish to calculate
@return Matrix
@throws Exception
Return the transpose of this matrix