Map the alternating group A5 to the rotations of an icosahedrona dodecahedron
8 years ago, the Math Stack Exchange was able to prove, in 523 characters of arcane incantation, that the alternating group A5 (ie all rearrangements of five objects that can be created by swapping two objects an even number of times) is isomorphic to the group of rotations of a dodecahedron that map vertices to vertices, edges to edges, and faces to faces. In my mind, 523 characters is far too many -- we can do better!
Challenge
To solve this challenge, take as input a member a of A5, represented as an even permutation of the first 5 integers, and output a 3x3 rotation matrix that maps a dodecahedron to itself. Your program must be an isomorphism: This means that your program must output a unique rotation matrix for each element a, and for any elements of A5 a, b, c such that a composed with b yields c, then YourProgram(a) * YourProgram(b) = YourProgram(c) (to within floating point precision, of course). Shortest program wins!
Example Input and Output
We present as an example one valid isomorphism, but any valid isomorphism is a permitted answer.
We assosciate the colored cubes [red, green, yellow, blue, black] with the numbers [1, 2, 3, 4, 5]. Then, for each permutation a in A5, our example outputs a matrix that rotates the figure shown so as to permute the colored cubes according to a.
[1, 2, 3, 4, 5] -> [[1, 0, 0][0, 1, 0],[0, 0, 1]]
[2, 3, 1, 4, 5] -> [[0, 0, 1], [1, 0, 0], [0, 1, 0]] (a 120 degree rotation along the axis (1, 1, 1)
[3, 4, 1, 2, 5] -> [[-1, 0, 0], [0, 1, 0], [0, 0, -1]] (a 180 degree rotation along the y axis ie coming towards the viewer)
[4, 2, 3, 5, 1] -> [[-0.3090170, 0.5, 0.8090170] [0.5, 0.8090170, -0.3090170] [-0.8090170, 0.3090170, -0.5]]
(a 60 degree rotation along the vector (1 / phi, phi, 0)