It is well known that the rotation matrix has the formula described here. I wonder how can I express these matrices in GAP with arbitrary rotating angles.
Edit:
- Dear Max Horn, thank you for your comments. But based on the description here:
I think your code snippet should be written as follows:
gap> n:=5;z:=E(n);a:=RealPart(z);b:=ImaginaryPart(z);
5
E(5)
1/2*E(5)+1/2*E(5)^4
1/2*E(20)-1/2*E(20)^9
gap> M:=[[a,-b],[b,a]];
[ [ 1/2*E(5)+1/2*E(5)^4, -1/2*E(20)+1/2*E(20)^9 ], [ 1/2*E(20)-1/2*E(20)^9, 1/2*E(5)+1/2*E(5)^4 ] ]
gap> Order(z);
5
gap> Order(M);
5
- As for the problem of "the added factor 4 in the order of the final matrix" represented by
[[b,-a],[a,b]], I can only come up with the following interpretation:[[b,-a],[a,b]]is an 18-degree rotation, while[[a,-b],[b,a]]is a 72-degree rotation as shown by the following test:
gap> n:=5;;z:=E(n);;a:=RealPart(z);;b:=ImaginaryPart(z);;
gap> M1:=[[a,-b],[b,a]];;
gap> M2:=[[b,-a],[a,b]];;
gap> Order(z);
5
gap> Order(M1);
5
gap> Order(M2);
20
gap> M2^4=M1;
true
Regards, HZ
