# A way to visualize permutations given in disjoint cycle notation

#### CubeExplorer

##### Member
I like to see the permutations in 3d like this:

A simple sage script makes it possible:
Code:
cg=CubeGroup()
#movseq=cg.parse("F*R*U*R^-1*U^-1*F^-1") #works
movseq=cg.parse("U*R2*F*B*R*B2*R*U2*L*B2*R*U^-1*D^-1*R2*F*R^-1*L*B2*U2*F2")#works
print("Move sequence example\n",movseq)
f=cg.facets(movseq)
print("Facets:\n",f)
n=[0]*len(f)
fInv=[0]*len(f)
for i in range(0,len(f)):
n[i]=i+1
fInv[f[i]-1]=i+1
print("Position of facet\n",n)
print("Origin of facet\n",fInv)
TransVec=([6,7,8,4,0,5,1,2,3,41,44,46,42,0,47,43,45,48,17,20,22,18,0,23,19,21,24]+
[33,36,38,34,0,39,35,37,40,11,10,9,13,0,12,16,15,14,25,28,30,26,0,31,27,29,32])
#dummy for tests
#fInv=[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,40,41,42,43,44,45,46,47,48]
CColors="yyyyyyyybbbbbbbbrrrrrrrrggggggggoooooooowwwwwwwwywrobg"
AC3out=""
for i in range(0,len(TransVec)):
tvi = TransVec[i]
if  tvi == 0:
cci = 48 + (i // 9)
else:
cci = tvi - 1;
#print("i",i,"tvi",tvi,"cci",cci)
#print("i",i,"tvi",tvi,"cci",cci,"fInv",(fInv+[49,50,51,52,53,54])[cci])
#print("CColors",CColors[(fInv+[49,50,51,52,53,54])[cci]-1])
AC3out+=CColors[(fInv+[49,50,51,52,53,54])[cci]-1]
print("Colors, copy and paste into AnimCube3:\n"+AC3out)
#===>>
Move sequence example
(2,34)(4,10)(5,26)(7,18)(12,37)(13,20)(15,44)(21,28)(23,42)(29,36)(31,45)(39,47)
Facets:
[1, 34, 3, 10, 26, 6, 18, 8, 9, 4, 11, 37, 20, 14, 44, 16, 17, 7, 19, 13, 28, 22, 42, 24, 25, 5, 27, 21, 36, 30, 45, 32, 33, 2, 35, 29, 12, 38, 47, 40, 41, 23, 43, 15, 31, 46, 39, 48]
Position of facet
[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, 40, 41, 42, 43, 44, 45, 46, 47, 48]
Origin of facet
[1, 34, 3, 10, 26, 6, 18, 8, 9, 4, 11, 37, 20, 14, 44, 16, 17, 7, 19, 13, 28, 22, 42, 24, 25, 5, 27, 21, 36, 30, 45, 32, 33, 2, 35, 29, 12, 38, 47, 40, 41, 23, 43, 15, 31, 46, 39, 48]
Colors, copy and paste into AnimCube3:
yrybygyoywbwrwowgwrbryrwrgrogoyowobobybrbobwbgrgygwgog

Thats all. Again a few lines are added for explanation how the result is generated.