Thread: rotation matrix
View Single Post
Old 2022-09-25, 00:50   #13
Dr Sardonicus
 
Dr Sardonicus's Avatar
 
Feb 2017
Nowhere

3×5×11×37 Posts
Default

It appears you are trying to solve

R[a;b] = [c;d]

where

R = [x,y;-y,x].

Writing as a system of linear equations,

x*a + y*b = c
b*x - a*y = d

which may be rewritten

[a,b;b,-a][x;y]=[c;d]

which is solvable if a^2 + b^2 ≠ 0.

EDIT: Feeding the formula to Pari-GP produces the same values you got:

Code:
? matsolve([Mod(2,31),Mod(3,31);Mod(3,31),Mod(-2,31)],Mod(1/13,31)*[Mod(5,31);Mod(9,31)])
%1 = 
[Mod(27, 31)]

[Mod(2, 31)]

? matsolve([Mod(2,31),Mod(3,31);Mod(3,31),Mod(-2,31)],Mod(1/13,31)*[Mod(4,31);Mod(11,31)])
%2 = 
[Mod(14, 31)]

[Mod(17, 31)]

? matsolve([Mod(2,31),Mod(3,31);Mod(3,31),Mod(-2,31)],Mod(1/13,31)*[Mod(6,31);Mod(15,31)])
%3 = 
[Mod(24, 31)]

[Mod(8, 31)]

Last fiddled with by Dr Sardonicus on 2022-09-25 at 16:35
Dr Sardonicus is offline   Reply With Quote