All problems
Rotation Error Geodesic
Problem
Compute the geodesic rotation error between two 3x3 rotation matrices in degrees.
Return degrees(acos(clamp((trace(R1^T R2) - 1) / 2, -1, 1))) rounded to 4 decimal places.
Test cases
case 1
in: [[[1,0,0],[0,1,0],[0,0,1]],[[1,0,0],[0,1,0],[0,0,1]]]
expected: 0
case 2
in: [[[1,0,0],[0,1,0],[0,0,1]],[[0,-1,0],[1,0,0],[0,0,1]]]
expected: 90
case 3
in: [[[0,-1,0],[1,0,0],[0,0,1]],[[-1,0,0],[0,-1,0],[0,0,1]]]
expected: 90
Starter codePython
def rotation_error(R1, R2):
# Your code here
pass3 test cases · run your code against them in the editor