1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
---
title: mtx_scroll
description: shift rows of a matrix
categories:
- object
pdcategory: Matrix Transformation
see_also:
- mtx_roll
inlets:
1st:
- type: matrix
description: input matrix
2nd:
- type: float
description: shift amount
outlets:
1st:
- type: matrix
description: output matrix
---
Shifts matrix rows by *shift amount* to the bottom, wrapping around.
If *shift amount* is negative, rows are shifted to the top.
$$
\operatorname{scroll}(\begin{pmatrix}
1 & 0 & 0 & 0 & 0 \cr
0 & 2 & 0 & 0 & 0 \cr
0 & 0 & 3 & 0 & 0 \cr
0 & 0 & 0 & 4 & 0 \cr
0 & 0 & 0 & 0 & 5
\end{pmatrix}, 2) = \begin{pmatrix}
0 & 0 & 0 & 4 & 0 \cr
0 & 0 & 0 & 0 & 5 \cr
1 & 0 & 0 & 0 & 0 \cr
0 & 2 & 0 & 0 & 0 \cr
0 & 0 & 3 & 0 & 0
\end{pmatrix}
$$
|