Aerospace toolbox rotations: right-handed or left-handed?

조회 수: 9 (최근 30일)
Tyler
Tyler 2013년 9월 15일
댓글: James Tursa 2020년 2월 7일
I'm getting myself all confused over this. Supposedly, the toolbox uses a right-handed coordinate system ( ref ). But this is producing a left-handed rotation matrix:
>> which angle2dcm
...../Matlab/toolbox/aero/aero/angle2dcm.m
>> angle2dcm(pi/2,0,0,'zyx')
ans =
0.000000000000000 1.000000000000000 0
-1.000000000000000 0.000000000000000 0
0 0 1.000000000000000
This behavior seems relatively consistent throughout the toolbox. Is the documentation just wrong?

채택된 답변

Mischa Kim
Mischa Kim 2013년 12월 9일
편집: Mischa Kim 2013년 12월 9일
It is proper right-handed. The rotation matrix for a right-handed rotation about the z-axis with a rotation angle psi is given by
Rz(psi) = [ cos(psi) sin(psi) 0;
-sin(psi) cos(psi) 0;
0 0 1]
For a rotation angle of 90 deg (pi/2) this results in
angle2dcm(pi/2,0,0,'zyx')
ans =
0.0000 1.0000 0
-1.0000 0.0000 0
0 0 1.0000
As an example, the vetor v in the graph below has coordinates [1; 0; 0] in the un-primed reference frame (left). When rotating the reference frame about 90 deg (right-handed) about the z-axis the vector points in negative y direction, [0; -1: 0], which corresponds to the result from the matrix-vector multiplication:
angle2dcm(pi/2,0,0,'zyx')*[1; 0; 0]
ans =
0.0000
-1.0000
0
  댓글 수: 4
Tamas Sarvary
Tamas Sarvary 2019년 1월 24일
@Mischa from the behavior of quatrotate I can see your observation is right but in the documentation that isn't mentioned at all.
"n = quatrotate(q,r) calculates the rotated vector, n, for a quaternion, q, and a vector, r."
James Tursa
James Tursa 2020년 2월 7일
See also this post. The quatrotate function should probably use the phrase "coordinate system transformation" instead of the phrase "rotated vector".

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Robust Control Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by