Rotate - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

# Online Help

###### All Products    Maple    MapleSim

ListTools

 Rotate
 rotate the elements in a list

 Calling Sequence Rotate(L, N)

Parameters

 L - list N - integer

Description

 • The Rotate(L, N) function rotates the elements in list L by N positions.
 • In the special case where L contains no elements, $\left[\right]$ is returned.

Examples

 > $L≔\left[1,2,3,4,5,6,7,8,9,10\right]$
 ${L}{≔}\left[{1}{,}{2}{,}{3}{,}{4}{,}{5}{,}{6}{,}{7}{,}{8}{,}{9}{,}{10}\right]$ (1)
 > $\mathrm{with}\left(\mathrm{ListTools}\right):$
 > $\mathrm{Rotate}\left(L,1\right)$
 $\left[{2}{,}{3}{,}{4}{,}{5}{,}{6}{,}{7}{,}{8}{,}{9}{,}{10}{,}{1}\right]$ (2)
 > $\mathrm{Rotate}\left(L,3\right)$
 $\left[{4}{,}{5}{,}{6}{,}{7}{,}{8}{,}{9}{,}{10}{,}{1}{,}{2}{,}{3}\right]$ (3)
 > $\mathrm{Rotate}\left(L,-3\right)$
 $\left[{8}{,}{9}{,}{10}{,}{1}{,}{2}{,}{3}{,}{4}{,}{5}{,}{6}{,}{7}\right]$ (4)
 > $\mathrm{Rotate}\left(L,-12\right)$
 $\left[{9}{,}{10}{,}{1}{,}{2}{,}{3}{,}{4}{,}{5}{,}{6}{,}{7}{,}{8}\right]$ (5)

 See Also