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

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 日

0 投票

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 件のコメント

Tyler
Tyler 2013 年 12 月 11 日
That is wrong, the equation you give is for a left-handed rotation matrix. (see wikipedia)
In your example you have rotated the coordinate system, but a rotation matrix times a vector rotates the vector. A 90deg right-handed, i.e. counter-clockwise, rotation of [1; 0; 0] about the z-axis points in the positive y direction.
Mischa Kim
Mischa Kim 2013 年 12 月 13 日
I appreciate your feedback because it might help clarify the difference between rotating a vector and describing the attitude of two frames of reference relative to each other. It also illustrates the fact that there is a lot of good information on wikipedia.
Rotation matrices are defined in the standard literature as one of many ways to describe the attitude of one reference frame relative to another, which is consistent with the documentation. In other words, given the components of a vector v in one reference frame one can use the rotation matrix to compute the components of that same vector in the other frame. Note, that this is not about rotating the vector itself.
For rotating vectors you would use MATLAB's rotx command and equivalent.
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 件)

質問済み:

2013 年 9 月 15 日

コメント済み:

2020 年 2 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by