why point correspondence to rotation matrix calculation is not my expected?

6 ビュー (過去 30 日間)
cui,xingxing
cui,xingxing 2022 年 5 月 11 日
コメント済み: cui,xingxing 2022 年 10 月 10 日
for example, at first ,one point P1(1,0,0) rotate pi/2 angle by y-axis,then get the point P2(0,0,-1), then rotate pi/2 angle by x-axis, then get the point P3(0,1,0). i use eul2rotm function to specify eular angle to get rotation matrix,then get the destination point by premultipy format,but get the result is not my expected P3?
P1 = [1,0,0];
eular = [0,pi/2,pi/2]
eular = 1×3
0 1.5708 1.5708
r = eul2rotm(eular,'ZYX'); % premultipy format
destinationPt = r*P1' % not same as P3 ?
destinationPt = 3×1
0.0000 0 -1.0000
if i take eular decompose into two component, ie rotate pi/2 angle correspondance to y-axis,x-axis, then i can get my expected result P3.
eularY = [0,pi/2,0];
eularX = [0,0,pi/2];
ry = eul2rotm(eularY);
rx = eul2rotm(eularX);
destiPt = rx*ry*P1' % is same as P3, which is my expect result.
destiPt = 3×1
0.0000 1.0000 -0.0000
i don't understand why eular angles vector three components not write together?

採用された回答

Matt J
Matt J 2022 年 5 月 11 日
編集済み: Matt J 2022 年 5 月 11 日
r needs to be pre-multiplied by P1, not post-multiplied.
P1 = [1,0,0];
eular = [0,pi/2,pi/2];
r = eul2rotm(eular,'ZYX');
destinationPt = P1*r
destinationPt = 1×3
0.0000 1.0000 0.0000
  12 件のコメント
Matt J
Matt J 2022 年 5 月 11 日
Great!
cui,xingxing
cui,xingxing 2022 年 10 月 10 日
It is good to hear that since R2022b, the computer vision toolbox and image process toolbox have started to support the use of the pre-multiply convention as a priority,while the default for other toolkboxs is the pre-multiply convention remains unchanged.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing and Computer Vision についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by