mersenneforum.org > Math rotation matrix
 User Name Remember Me? Password
 Register FAQ Search Today's Posts Mark Forums Read

 2022-07-20, 14:07 #1 bhelmes     Mar 2016 22×3×5×7 Posts rotation matrix A peaceful night for you, the weather in Germany was yesterday and today a little bit hot, which is not ideal for me to think about math. Normally I prefer a temperature under 25 degree in the night. I had to stop mprime and switch off my computer. Let p:=31, a:=4+5i, b:=8+15i with 4²+5²=8²+15²=10 mod p this means for me, that both gaussian numbers have a same norm, which is not the same as the euklid norm. Is there a rotation matrix R with det(R)=1 which transform a=R*b ?
2022-07-21, 14:24   #2
Chris Card

Aug 2004

7·19 Posts

Quote:
 Originally Posted by bhelmes A peaceful night for you, the weather in Germany was yesterday and today a little bit hot, which is not ideal for me to think about math. Normally I prefer a temperature under 25 degree in the night. I had to stop mprime and switch off my computer. Let p:=31, a:=4+5i, b:=8+15i with 4²+5²=8²+15²=10 mod p this means for me, that both gaussian numbers have a same norm, which is not the same as the euklid norm. Is there a rotation matrix R with det(R)=1 which transform a=R*b ?
23 -12
25 -13

?

Last fiddled with by Chris Card on 2022-07-21 at 15:19

2022-07-23, 06:23   #3
bhelmes

Mar 2016

22·3·5·7 Posts

Quote:
 Originally Posted by Chris Card What about 23 -12 25 -13 ?
There is a logical error in my thinking and I could not solve the paradox :

a:=4+5i, b:=8+15i
If I regard the euklidean norm of both vectors:
||a||=sqrt (16+25)=sqrt (41)
||b||=sqrt (64+225)=sqrt (289)
and I could not reduce it mod p, because there is the sqrt.
As the euklidean norm is not the same, there could not be a rotation matrix with det (R)=1,
which conserves the length of the vector.

If I regard the norm as ||a||:=16+25=41 and ||b||:=64+225=289 I could operate with mod p,
and both vectors are set on the same circle and there exist a rotation matrix,
as indicated above.

Strange. Any ideas where the logical error is hidden ?

2022-07-25, 12:20   #4
Chris Card

Aug 2004

7×19 Posts

Quote:
 Originally Posted by bhelmes There is a logical error in my thinking and I could not solve the paradox : a:=4+5i, b:=8+15i If I regard the euklidean norm of both vectors: ||a||=sqrt (16+25)=sqrt (41) ||b||=sqrt (64+225)=sqrt (289) and I could not reduce it mod p, because there is the sqrt. As the euklidean norm is not the same, there could not be a rotation matrix with det (R)=1, which conserves the length of the vector. If I regard the norm as ||a||:=16+25=41 and ||b||:=64+225=289 I could operate with mod p, and both vectors are set on the same circle and there exist a rotation matrix, as indicated above. Strange. Any ideas where the logical error is hidden ?
The matrix I gave has determinant 1, but is it a rotation matrix?
Not as a matrix over the integers certainly.
A square matrix R is a rotation matrix if and only if transpose(R) = inverse(R) and det R = 1.
https://en.wikipedia.org/wiki/Rotation_matrix
It doesn't appear to be a rotation matrix mod 31 either - sorry :(
But I think this is

20 2
-2 20

Chris

Last fiddled with by Chris Card on 2022-07-25 at 12:58

 2022-07-26, 13:59 #5 Dr Sardonicus     Feb 2017 Nowhere 2·3·17·61 Posts A "norm" is usually defined as being positive-definite, which makes no sense in modulo arithmetic. Fortunately, what we're dealing with is a vector space over a field (the finite field of the integers modulo p, where p is a prime number). The usual formulas for matrix multiplication and inner product apply; but the results are integers modulo p rather than real numbers. But the definition of a "rotation matrix" (a square matrix with determinant 1 whose inverse equals its transpose) still makes sense. There is a straightforward solution to the stated problem, based on a well known formula for multiplying two expressions which are the sum of two squares. This formula is (A^2 + B^2)*(C^2 + D^2) = (A*C ± B*D)^2 + (A*D ∓ B*C)^2 Suppose that p is a prime number, n (mod p) is a non-zero residue, and we have a^2 + b^2 == n (mod p) and c^2 + d^2 == n (mod p). The above formula gives (a*c ± b*d)^2 + (a*d ∓ b*c)^2 == n^2 (mod p) Dividing through by n^2 (which uses the hypothesis that n (mod p) is non-zero) gives ((a*c ± b*d)/n)^2 + ((a*d ∓ b*c)/n)^2 == 1 (mod p) That is, for either choice of signs we have a pair (x, y) x^2 + y^2 == 1 (mod p) We also have a*(a*c + b*d) - b*(a*d - b*c) = (a^2 + b^2)*c, and b*(a*c + b*d) + a*(a*d-b*c) = (a^2 + b^2)*d. Thus, we have, with n = a^2 + b^2 = c^2 + d^2, x = (a*c + b*d)/n and y = (a*d - b*c)/n, with the 2x2 matrix M = [x, -y; y, x], M[a;b] = [c;d] (the determinant is x^2 + y^2 = 1, and the inverse is equal to the transpose). In the case at hand, taking a = 8, b = 15, c = 4, and d = 5 (mod 31) these formulas give M = [20;2;-2;20] (mod 31). (Here, I am using the Pari-GP convention that the entries in a row are separated by commas, and the rows are separated by semicolons.) Note: I had to rewrite the section in bold. I had the right approach, but transposing things and minus signs are among the banes of my existence. I fixed up the details, and made the appropriate revisions. Last fiddled with by Dr Sardonicus on 2022-07-27 at 13:58 Reason: Add omitted condition, and as indicated
 2022-08-20, 01:18 #7 bhelmes     Mar 2016 22·3·5·7 Posts A peaceful and pleasant night for you, this is a beautiful and colored representation of numbers with the according rotation matrixs. It is not perfect, but I thought LaurV or Serge could use them and will be happy about it: http://devalco.de/unit_circle/system...ns.php?prim=31 Greetings from Germany
 2022-09-17, 01:02 #8 bhelmes     Mar 2016 22×3×5×7 Posts Basic rotation matrixes A peaceful night for you, where ever you sleep, Are there three basic rotation matrices, like E = (1 0) = Identity with determinant (E) = 1 (0 1) M1 = (1 -1) with determinant (M1) = 2 (1 1) and M2 = (1 1) with determinant (M2) = 2 (-1 1) and all resulting rotation matrices a product of two scalars and the basic matrices, so that det (M)=1 mod p ? Example: p=31 v1=2+3i v2=5+9i v3=4+11i v4=6+15i norm (v1) = 2²+3² = 13 = 12⁻¹ mod 31 norm (v2) = 5²+9² = 13 = 12⁻¹ mod 31 norm (v3) = 4²+11² = 13 = 12⁻¹ mod 31 norm (v4) = 6²+15² = 13 = 12⁻¹ mod 31 12*5* (2,1)*(2)=(5) (-1,2) (3)=(9) 12*27* (1,1)*(2)=(5) (-1,1) (3)=(9) 12*2* (1,10)*(2)=(5) (-10,1) (3)=(9) http://devalco.de/unit_circle/system_tangens.php P.S. I made a contract for 35 cent / kwh up to 31.10. which will enable my work for Gimps. Last fiddled with by bhelmes on 2022-09-17 at 01:04
2022-09-17, 22:14   #9
Dr Sardonicus

Feb 2017
Nowhere

11000010011102 Posts

Quote:
 Originally Posted by bhelmes A peaceful night for you, where ever you sleep, Are there three basic rotation matrices, like E = (1 0) = Identity with determinant (E) = 1 (0 1) M1 = (1 -1) with determinant (M1) = 2 (1 1) and M2 = (1 1) with determinant (M2) = 2 (-1 1) and all resulting rotation matrices a product of two scalars and the basic matrices, so that det (M)=1 mod p ?
A rotation matrix has determinant 1 by definition, so M1 and M2 are not rotation matrices.

If p is an odd prime, we have seen that if p == 3 (mod 4) there are p+1 rotation matrices (mod p), and if p == 1 (mod 4) there are p-1 rotation matrices (mod p).

I note that the rotation matrix [0,1;-1,0] has multiplicative order 4, proving that the group of rotation matrices (mod p) always has order divisible by 4.

I checked for 2 < p < 200 and found that the group of rotation matrices (mod p) was always cyclic. I'm convinced this is always the case, but don't presently see how to prove it.

I give cyclic generators for 2 < p < 100

p, group order, cyclic generator.
Code:
3 4 [Mod(0, 3), Mod(1, 3); Mod(2, 3), Mod(0, 3)]
5 4 [Mod(0, 5), Mod(1, 5); Mod(4, 5), Mod(0, 5)]
7 8 [Mod(2, 7), Mod(2, 7); Mod(5, 7), Mod(2, 7)]
11 12 [Mod(3, 11), Mod(5, 11); Mod(6, 11), Mod(3, 11)]
13 12 [Mod(2, 13), Mod(6, 13); Mod(7, 13), Mod(2, 13)]
17 16 [Mod(4, 17), Mod(6, 17); Mod(11, 17), Mod(4, 17)]
19 20 [Mod(3, 19), Mod(7, 19); Mod(12, 19), Mod(3, 19)]
23 24 [Mod(4, 23), Mod(10, 23); Mod(13, 23), Mod(4, 23)]
29 28 [Mod(5, 29), Mod(11, 29); Mod(18, 29), Mod(5, 29)]
31 32 [Mod(2, 31), Mod(11, 31); Mod(20, 31), Mod(2, 31)]
37 36 [Mod(2, 37), Mod(16, 37); Mod(21, 37), Mod(2, 37)]
41 40 [Mod(13, 41), Mod(18, 41); Mod(23, 41), Mod(13, 41)]
43 44 [Mod(3, 43), Mod(11, 43); Mod(32, 43), Mod(3, 43)]
47 48 [Mod(4, 47), Mod(19, 47); Mod(28, 47), Mod(4, 47)]
53 52 [Mod(5, 53), Mod(20, 53); Mod(33, 53), Mod(5, 53)]
59 60 [Mod(11, 59), Mod(23, 59); Mod(36, 59), Mod(11, 59)]
61 60 [Mod(2, 61), Mod(27, 61); Mod(34, 61), Mod(2, 61)]
67 68 [Mod(3, 67), Mod(27, 67); Mod(40, 67), Mod(3, 67)]
71 72 [Mod(13, 71), Mod(20, 71); Mod(51, 71), Mod(13, 71)]
73 72 [Mod(6, 73), Mod(29, 73); Mod(44, 73), Mod(6, 73)]
79 80 [Mod(2, 79), Mod(32, 79); Mod(47, 79), Mod(2, 79)]
83 84 [Mod(3, 83), Mod(18, 83); Mod(65, 83), Mod(3, 83)]
89 88 [Mod(13, 89), Mod(30, 89); Mod(59, 89), Mod(13, 89)]
97 96 [Mod(14, 97), Mod(22, 97); Mod(75, 97), Mod(14, 97)]

Last fiddled with by Dr Sardonicus on 2022-09-17 at 22:15 Reason: Insert missing qualifier

2022-09-18, 23:23   #10
bhelmes

Mar 2016

42010 Posts

Quote:
 Originally Posted by Dr Sardonicus A rotation matrix has determinant 1 by definition, so M1 and M2 are not rotation matrices.
Every matrix M of the form
(x -y)
(y x)

with determinant (M)=x²+y² can be transformed by a scalar multiplication of the matrix by the inverse of the determinant
into a rotation matrix with determinant 1,

the determinant (M)=2 has an strong advantage, if the calculation is made modulo a Mersenne number.

As the 3 rotation matrices are calculated by 4 vectors of the same norm,
the belonging rotation matrices seem to build a connection between f(x)=x²+1 and g(x)=x²+x+1.

If I have one vector (a, bi) with the norm d=a²+b², I am only interesting in one rotation matrix,
with which I could find the rational point on the same circle with the radius of the norm.

I thought that
d*e*M1 with d=a²+b² and e well chosen so that det (d*e*M1)=1 should be one solution.

This was more than a brainstorm as exact mathematical explication,
but I think the Romulan Translator will get the idea,
and perhaps some more sophisticated Mathematicians will get the idea, too.

Sorry if the mathematical correctness suffers from the speed of ideas.

I

I tried to calculate the belonging matrices, and the red ones (non quadratic residues) are the interesting part.
http://devalco.de/unit_circle/system_tangens.php

There may be some stupid programming errors and I beg pardon for it.
Perhaps I have missed some - or symmetrical axes.

Last fiddled with by bhelmes on 2022-09-18 at 23:25

2022-09-19, 21:56   #11
Dr Sardonicus

Feb 2017
Nowhere

184E16 Posts

Quote:
 Originally Posted by bhelmes Every matrix M of the form (x -y) (y x) with determinant (M)=x²+y² can be transformed by a scalar multiplication of the matrix by the inverse of the determinant into a rotation matrix with determinant 1
No, sir. If M is a 2x2 matrix, scalar multiplication of M by k produces a matrix with determinant k^2*det(M). Thus, if M is a nonsingular 2x2 matrix, det((1/det(M))M) is 1/det(M).

If M is 2x2 and det(M) is not a square, no scalar multiple of M will have determinant 1.

Meanwhile, I have devised a proof that the group of 2x2 rotation matrices (mod p), AKA the "special orthogonal group" SO(2) over Fp is cyclic.

The order of the group is n = p+1 when p == 3 (mod 4) and n = p-1 when p == 1 (mod 4).

Note that if a^2 + b^2 == 1 (mod p), the characteristic polynomial of the rotation matrix M = [Mod(a,p), Mod(b,p);Mod(-b,p),Mod(a,p)] is x^2 - 2*a*x + 1 (mod p). The multiplicative order of M is n when the characteristic polynomial divides the cyclotomic polynomial of primitive nth roots of unity (mod p).

Note that, if p == 3 (mod 4) we have p = n-1, so the cyclotomic polynomial splits into quadratic factors. Calling one of these x^2 - 2*a*x + 1 (mod p) we see that the discriminant 4*a^2 - 4 is not a square (mod p). Since p == 3 (mod 4), we have that 4 - 4*a^2 is a square (mod p), so that 1 - a^2 is a square (mod p). If p == 1 (mod 4) we have p = n+1 so the cyclotomic polynomial splits into linear factors (mod p). Forming a quadratic using two reciprocal roots, we again have a quadratic x^2 - 2*a*x + 1. Because the quadratic is the product of two linear factors, the discriminant 4*a^2 - 4 is a square (mod p). Since here p == 1 (mod 4), -1 is a square (mod p), so that 4 - 4*a^2 is also a square (mod p), and so 1 - a^2 is a square (mod p).

Thus, in either case an a and b to form a rotation matrix of multiplicative order n can always be found. The following simple Pari-GP script produces cyclic generators M for odd primes less than 100.

Code:
{
forprime(p=3,100,
if(p%4==3,
n=p+1;
F=factormod(polcyclo(n),p);
a=-polcoeff(F[1,1],1,x)/2;
N=factor(x^2-1+a^2);
b=polcoeff(N[1,1],0,x);
M=[a,b;-b,a];
print(p" "M)
,
n=p-1;
F=factormod(polcyclo(n),p);
r=-polcoeff(F[1,1],0,x);
a=(r+1/r)/2;
N=factor(x^2-1+a^2);
b=polcoeff(N[1,1],0,x);
M=[a,b;-b,a];
print(p" "M)
);
)
}
3 [Mod(0, 3), Mod(1, 3); Mod(2, 3), Mod(0, 3)]
5 [Mod(0, 5), Mod(1, 5); Mod(4, 5), Mod(0, 5)]
7 [Mod(2, 7), Mod(2, 7); Mod(5, 7), Mod(2, 7)]
11 [Mod(3, 11), Mod(5, 11); Mod(6, 11), Mod(3, 11)]
13 [Mod(2, 13), Mod(6, 13); Mod(7, 13), Mod(2, 13)]
17 [Mod(4, 17), Mod(6, 17); Mod(11, 17), Mod(4, 17)]
19 [Mod(16, 19), Mod(7, 19); Mod(12, 19), Mod(16, 19)]
23 [Mod(10, 23), Mod(4, 23); Mod(19, 23), Mod(10, 23)]
29 [Mod(6, 29), Mod(9, 29); Mod(20, 29), Mod(6, 29)]
31 [Mod(29, 31), Mod(11, 31); Mod(20, 31), Mod(29, 31)]
37 [Mod(8, 37), Mod(14, 37); Mod(23, 37), Mod(8, 37)]
41 [Mod(14, 41), Mod(16, 41); Mod(25, 41), Mod(14, 41)]
43 [Mod(20, 43), Mod(17, 43); Mod(26, 43), Mod(20, 43)]
47 [Mod(43, 47), Mod(19, 47); Mod(28, 47), Mod(43, 47)]
53 [Mod(12, 53), Mod(4, 53); Mod(49, 53), Mod(12, 53)]
59 [Mod(25, 59), Mod(5, 59); Mod(54, 59), Mod(25, 59)]
61 [Mod(14, 61), Mod(7, 61); Mod(54, 61), Mod(14, 61)]
67 [Mod(32, 67), Mod(7, 67); Mod(60, 67), Mod(32, 67)]
71 [Mod(33, 71), Mod(30, 71); Mod(41, 71), Mod(33, 71)]
73 [Mod(12, 73), Mod(21, 73); Mod(52, 73), Mod(12, 73)]
79 [Mod(77, 79), Mod(32, 79); Mod(47, 79), Mod(77, 79)]
83 [Mod(40, 83), Mod(12, 83); Mod(71, 83), Mod(40, 83)]
89 [Mod(28, 89), Mod(14, 89); Mod(75, 89), Mod(28, 89)]
97 [Mod(75, 97), Mod(14, 97); Mod(83, 97), Mod(75, 97)]
?

 Similar Threads Thread Thread Starter Forum Replies Last Post bhelmes Number Theory Discussion Group 4 2022-02-14 15:04 bhelmes Number Theory Discussion Group 5 2017-08-17 21:12 Xyzzy Lounge 13 2017-02-21 18:29 fivemack Factoring 11 2009-08-18 17:39 oslik Factoring 22 2008-11-02 12:53

All times are UTC. The time now is 08:44.

Thu Feb 2 08:44:53 UTC 2023 up 168 days, 6:13, 1 user, load averages: 1.10, 1.03, 0.98

Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔