필터 지우기
필터 지우기

3D Rotation Matrix

조회 수: 125 (최근 30일)
N/A
N/A 2017년 7월 24일
댓글: Alec 2019년 10월 23일
Hi all, I'm new here and am trying to obtain a 3D rotation matrix.
Currently, I have a set of n points: (x1,y1,z1), (x2,y2,z2)...(xn,yn,zn)
from which I have designated one particular point as the origin, and obtained an x'- and y'- vector, based on some features. It is unimportant, for this question, how I chose my origin and got the x'- and y' vector. From the x'- and y' vector, I can also obtain the z'-vector by taking cross product of x' and y'.
Now, I would like to rotate all these points about the origin I have defined, such that the x'-, y'- and z'- vectors are in line with the x-, y- and z- axes respectively.
Hence, I am looking for a 3x3 rotation matrix, R, that can be applied to all points such that:
Transformed (x,y,z) = R * Original (x,y,z)
An example of the vectors to be mapped would be say:
x': [-0.2831, -0.9246, 0.2548]' to be mapped to x: [1 0 0]
y': [0.9242, -0.1919, 0.3303]' to be mapped to y: [0 1 0]
z' will be mapped automatically if the above 2 are satisfied.
Thank you for your help!
  댓글 수: 1
Walter Roberson
Walter Roberson 2017년 7월 24일
편집: Walter Roberson 2017년 7월 24일
Duplicates https://www.mathworks.com/matlabcentral/answers/349968-3d-rotation-matrix but this one appears to have been updated so I have closed that.

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

채택된 답변

Honglei Chen
Honglei Chen 2017년 7월 24일
I'm not sure if I fully follow your question, but here is my understanding. The first step is to find the coordinates of all points in the new coordinate system. For that you'll have to first subtract origin from all points and then convert all points to the local coordinate system. That conversion matrix should just be R1 = [x' y' z']'. If you have access to Phased Array System Toolbox, you can consider using the following function
You can then rotate the points in the new coordinate system using Euler matrices. If you want again you can use the following functions:
HTH

추가 답변 (1개)

Herve Hugonnet
Herve Hugonnet 2019년 6월 20일
The simplest if you do not have the phase array system toolbox is to define anonymous functions :
rotx = @(t) [1 0 0; 0 cos(t) -sin(t) ; 0 sin(t) cos(t)] ;
roty = @(t) [cos(t) 0 sin(t) ; 0 1 0 ; -sin(t) 0 cos(t)] ;
rotz = @(t) [cos(t) -sin(t) 0 ; sin(t) cos(t) 0 ; 0 0 1] ;
  댓글 수: 1
Alec
Alec 2019년 10월 23일
Thanks for this

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

카테고리

Help CenterFile Exchange에서 Motion Modeling and Coordinate Systems에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by