WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center

RotateLeft [expr,n]

cycles the elements in expr n positions to the left.

RotateLeft [expr]

cycles one position to the left.

RotateLeft [expr,{n1,n2,}]

cycles elements at successive levels ni positions to the left.

Details
Details and Options Details and Options
Examples  
Basic Examples  
Generalizations & Extensions  
Applications  
See Also
Tech Notes
Related Guides
Related Links
History
Cite this Page

RotateLeft [expr,n]

cycles the elements in expr n positions to the left.

RotateLeft [expr]

cycles one position to the left.

RotateLeft [expr,{n1,n2,}]

cycles elements at successive levels ni positions to the left.

Details

Examples

open all close all

Basic Examples  (4)

Rotate two positions to the left:

Wolfram Language code: RotateLeft[{a, b, c, d, e}, 2]

Rotate one position to the left:

Wolfram Language code: RotateLeft[{a, b, c, d, e}]

Rotate Association one position to the left:

Wolfram Language code: RotateLeft[<|1 -> a, 2 -> b, 3 -> c|>]

Rotate Association on the first and second levels:

Wolfram Language code: RotateRight[<|1 -> {a, b}, 2 -> {b, c}, 3 -> {c, d}|>, {1, 1}]

Generalizations & Extensions  (2)

Rotate one position left at the first level, and right at the second level:

Wolfram Language code: RotateLeft[{{a, b, c}, {d, e, f}, {g, h, i}}, {1, -1}]

Rotate an expression with any head:

Wolfram Language code: RotateLeft[f[x, y, z]]

Applications  (4)

Successively rotate a list left:

Wolfram Language code: NestList[RotateLeft, {a, b, c, d, e}, 4]

Rotate successive rows of a matrix by their row number:

Wolfram Language code: MapIndexed[RotateLeft, Table[{a, b, c, d}, {5}]]//TableForm

Rotate a 2D image:

Wolfram Language code: ArrayPlot[RotateLeft[Table[If[x ^ 2 + y ^ 2 < 1, 1, 0], {x, -1, 1, 1 / 100}, {y, -1, 1, 1 / 100}], {40, 20}]]

Rotate operands:

Wolfram Language code: RotateLeft[a.b.c.d.e]

See Also

RotateRight   Reverse   PadLeft   BitShiftLeft

Function Repository: RotateLeftUntil

History

Introduced in 1988 (1.0) | Updated in 2003 (5.0)

Wolfram Research (1988), RotateLeft, Wolfram Language function, https://reference.wolfram.com/language/ref/RotateLeft.html (updated 2003).

Text

Wolfram Research (1988), RotateLeft, Wolfram Language function, https://reference.wolfram.com/language/ref/RotateLeft.html (updated 2003).

CMS

Wolfram Language. 1988. "RotateLeft." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2003. https://reference.wolfram.com/language/ref/RotateLeft.html.

APA

Wolfram Language. (1988). RotateLeft. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RotateLeft.html

BibTeX

@misc{reference.wolfram_2026_rotateleft, author="Wolfram Research", title="{RotateLeft}", year="2003", howpublished="\url{https://reference.wolfram.com/language/ref/RotateLeft.html}", note=[Accessed: 12-June-2026]}

BibLaTeX

@online{reference.wolfram_2026_rotateleft, organization={Wolfram Research}, title={RotateLeft}, year={2003}, url={https://reference.wolfram.com/language/ref/RotateLeft.html}, note=[Accessed: 12-June-2026]}

Top [フレーム]

AltStyle によって変換されたページ (->オリジナル) /