Back to FabImage Studio website
You are here: Start » Filter Reference » Array Transforms » RotateArray
Cyclically shifts the elements of an array.
Name | Type | Description | |
---|---|---|---|
![]() |
inArray | <T>Array | Input array |
![]() |
inShift | Integer | Input the number of positions each element should be shifted by |
![]() |
inInverse | Bool | Reversed direction of shift |
![]() |
outArray | <T>Array | Cyclically shifted array |
The type of this filter is defined using the type variable T which represents any valid type. Read more.
Description
The operation moves each of the inArray elements forward by inShift positions. Whenever the resulting index exceeds the size of the array, it cycles back to the beginning of the array.
Examples
![]() |
![]() |
inArray = {1,2,3,4,5,6,7} inShift = 2 |
outArray = {6,7,1,2,3,4,5} |
Complexity Level
This filter is available on Advanced Complexity Level.
See Also
- ReverseArray – Creates an array of the input array elements in reversed order.
- SlideArray – Creates two copies of the input array - one with elements removed at the beginning, the other with elements removed at the end.
- SwapArrayElements – Swaps two elements of an array.