Is it the Global frame-of-reference or Local frame-of-reference of the rotation
up vote
0
down vote
favorite
I need to translate the rotation matrix to Euler angle.
And following this blog https://www.learnopencv.com/rotation-matrix-to-euler-angles/, I saw the Python code like (using order 'z, y, x'):
def rotation_matrix_to_euler_angles(matrix):
sy = math.sqrt(matrix[0,0] * matrix[0,0] + matrix[1,0] * matrix[1,0])
singular = sy < 1e-6
if not singular :
x = math.atan2(matrix[2, 1] , matrix[2, 2])
y = math.atan2(-matrix[2,0], sy)
z = math.atan2(matrix[1,0], matrix[0,0])
else :
x = math.atan2(-matrix[1, 2], matrix[1, 1])
y = math.atan2(-matrix[2,0], sy)
z = 0
return [x, y, z]
Or you can find the other solutions for other orders in:
https://www.geometrictools.com/Documentation/EulerAngles.pdf
But in the blog and in the PDF, they didn't mention which frame-of-reference they were using. So I am not sure, this solution is Global frame-of-reference or Local frame-of-reference of the rotation.
python rotation euler-angles
add a comment |
up vote
0
down vote
favorite
I need to translate the rotation matrix to Euler angle.
And following this blog https://www.learnopencv.com/rotation-matrix-to-euler-angles/, I saw the Python code like (using order 'z, y, x'):
def rotation_matrix_to_euler_angles(matrix):
sy = math.sqrt(matrix[0,0] * matrix[0,0] + matrix[1,0] * matrix[1,0])
singular = sy < 1e-6
if not singular :
x = math.atan2(matrix[2, 1] , matrix[2, 2])
y = math.atan2(-matrix[2,0], sy)
z = math.atan2(matrix[1,0], matrix[0,0])
else :
x = math.atan2(-matrix[1, 2], matrix[1, 1])
y = math.atan2(-matrix[2,0], sy)
z = 0
return [x, y, z]
Or you can find the other solutions for other orders in:
https://www.geometrictools.com/Documentation/EulerAngles.pdf
But in the blog and in the PDF, they didn't mention which frame-of-reference they were using. So I am not sure, this solution is Global frame-of-reference or Local frame-of-reference of the rotation.
python rotation euler-angles
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I need to translate the rotation matrix to Euler angle.
And following this blog https://www.learnopencv.com/rotation-matrix-to-euler-angles/, I saw the Python code like (using order 'z, y, x'):
def rotation_matrix_to_euler_angles(matrix):
sy = math.sqrt(matrix[0,0] * matrix[0,0] + matrix[1,0] * matrix[1,0])
singular = sy < 1e-6
if not singular :
x = math.atan2(matrix[2, 1] , matrix[2, 2])
y = math.atan2(-matrix[2,0], sy)
z = math.atan2(matrix[1,0], matrix[0,0])
else :
x = math.atan2(-matrix[1, 2], matrix[1, 1])
y = math.atan2(-matrix[2,0], sy)
z = 0
return [x, y, z]
Or you can find the other solutions for other orders in:
https://www.geometrictools.com/Documentation/EulerAngles.pdf
But in the blog and in the PDF, they didn't mention which frame-of-reference they were using. So I am not sure, this solution is Global frame-of-reference or Local frame-of-reference of the rotation.
python rotation euler-angles
I need to translate the rotation matrix to Euler angle.
And following this blog https://www.learnopencv.com/rotation-matrix-to-euler-angles/, I saw the Python code like (using order 'z, y, x'):
def rotation_matrix_to_euler_angles(matrix):
sy = math.sqrt(matrix[0,0] * matrix[0,0] + matrix[1,0] * matrix[1,0])
singular = sy < 1e-6
if not singular :
x = math.atan2(matrix[2, 1] , matrix[2, 2])
y = math.atan2(-matrix[2,0], sy)
z = math.atan2(matrix[1,0], matrix[0,0])
else :
x = math.atan2(-matrix[1, 2], matrix[1, 1])
y = math.atan2(-matrix[2,0], sy)
z = 0
return [x, y, z]
Or you can find the other solutions for other orders in:
https://www.geometrictools.com/Documentation/EulerAngles.pdf
But in the blog and in the PDF, they didn't mention which frame-of-reference they were using. So I am not sure, this solution is Global frame-of-reference or Local frame-of-reference of the rotation.
python rotation euler-angles
python rotation euler-angles
edited Nov 11 at 12:32
Zoe
10.4k73575
10.4k73575
asked Nov 11 at 0:41
Colin Ji
513314
513314
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244826%2fis-it-the-global-frame-of-reference-or-local-frame-of-reference-of-the-rotation%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown