フィルターのクリア

Decomposing a Transformation Matrix

24 ビュー (過去 30 日間)
Kash Costello
Kash Costello 2018 年 11 月 28 日
編集済み: Matt J 2018 年 11 月 28 日
Hi!
I have been trying to look for a function that will "undo" a transformation matrix.
I saw in Matlab that there's a function "makehgtform" to create a transformation matrix. Now, I'm looking for something that is the exact opposite of this.
Example:
M = makehgtform('xrotate',30*pi/180);
It would result to a 4x4 matrix. But I want to actually extract the X, Y, Z translation and X,Y,Z rotation.
Can anyone help me or just give me an idea? I would really appreciate it! :(
Thanks in advance!

採用された回答

Matt J
Matt J 2018 年 11 月 28 日
編集済み: Matt J 2018 年 11 月 28 日
Here's an example that makes use of the attached file for rotation matrix decomposition.
>> M = makehgtform('translate',[1,2,3],'xrotate',30*pi/180)
M =
1.0000 0 0 1.0000
0 0.8660 -0.5000 2.0000
0 0.5000 0.8660 3.0000
0 0 0 1.0000
>> translation=M(1:3,end)
translation =
1
2
3
>> rotation=rot2taitbryan(M(1:3,1:3),'xyz'), %see attached file
rotation =
30.0000 0 0
  9 件のコメント
Kash Costello
Kash Costello 2018 年 11 月 28 日
Ok I'm being an idiot but I'm still confused even after reading that document. I guess I don't fully grasp what atan2 is and still, it didn't explain why the sequence is like that. My question still remains... :(
Matt J
Matt J 2018 年 11 月 28 日
編集済み: Matt J 2018 年 11 月 28 日
I guess I don't fully grasp what atan2 is

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

その他の回答 (1 件)

Bruno Luong
Bruno Luong 2018 年 11 月 28 日
Translation vector is T(1:3,4);
Rotation matrix is T(1:3,1:3).
If you want to decompose in rotation on axis, there are many conventions (intrinsic, extrinsic, Euler's angle, Tait–Bryan angles, etc...) see https://en.wikipedia.org/wiki/Euler_angles and pick your choice.

カテゴリ

Help Center および File ExchangeSparse Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by