Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get the rotations and reflections of an array
ResourceFunction["ArrayRotations"][array] returns the eight rotations and reflections of the given 2D array. | |
ResourceFunction["ArrayRotations"][array,False] returns the four rotations only. |
| R0 | Identity | |
| R90 | Transpose + Reverse rows | |
| R180 | Reverse both rows and columns | |
| R270 | Transpose + Reverse columns | |
| MA | Transpose + Reverse both (Antidiagonal mirror) | |
| MH | Reverse rows (Horizonal mirror) | |
| MD | Transpose (Diagonal mirror) | |
| MV | Reverse columns (Vertical mirror) |
The eight rotations and reflections of an array:
| In[1]:= |
| Out[1]= |
Images of the returned arrays:
| In[2]:= |
| Out[2]= | ![]() |
Show only the rotations:
| In[3]:= |
| Out[3]= |
| In[4]:= |
| Out[4]= | ![]() |
Six different arrays:
| In[5]:= |
| Out[5]= | ![]() |
A canonical form of each array under symmetry:
| In[6]:= |
| Out[6]= | ![]() |
A canonical form of each array using rotations only:
| In[7]:= |
| Out[7]= | ![]() |
Wolfram Language 14.0 (January 2024) or above
This work is licensed under a Creative Commons Attribution 4.0 International License