From this paper I'm trying to use a method for comparing the distance between two rotation matrices. I'm using Φ6(R1,R2) = ||$log(R_1R_2^T )$|| (left side, page 159). When I tried this in python the answer this is providing is off by *sqrt(2). Is that because I'm misinterpretting the notation, or doing something wrong in python?
Python:
r1 = R.from_euler('xyz', [0,0,0],degrees = True).as_matrix()
r2 = R.from_euler('xyz', [0,0,90],degrees = True).as_matrix()
print("r1")
print(r1)
print("r2")
print(r2)
angle_dif_mat = logm(np.matmul(r1,r2.transpose()))
print("Angle dif")
print(angle_dif_mat)
print("norm")
print(np.linalg.norm(angle_dif_mat))
print("this = expected*sqrt(2)")
print("expected = pi/2")
Output:
r1
[[1. 0. 0.]
[0. 1. 0.]
[0. 0. 1.]]
r2
[[ 2.22044605e-16 -1.00000000e+00 0.00000000e+00]
[ 1.00000000e+00 2.22044605e-16 0.00000000e+00]
[ 0.00000000e+00 0.00000000e+00 1.00000000e+00]]
Angle dif
[[-2.22044605e-16 1.57079633e+00 0.00000000e+00]
[-1.57079633e+00 -2.22044605e-16 0.00000000e+00]
[ 0.00000000e+00 0.00000000e+00 0.00000000e+00]]
norm
2.2214414690791826
this = expected*sqrt(2)
expected = pi/2
So is the L2 norm the spectral norm? And therefore am I looking for the largest singular value? And is the Frobenius norm the "square root of the sum of the squares" norm?
And so does the L2 norm of LogR give theta?
– Rory McDonald Feb 27 '20 at 15:41