Info

此问题已关闭。 请重新打开它进行编辑或回答。

3D Rotation Matrix

12 次查看(过去 30 天)
N/A
N/A 2017-7-24
关闭: Walter Roberson 2017-7-24
Hi all, I'm new here and am trying to obtain a 3D rotation matrix.
Currently, I have a set of points (x,y,z) from which I have designated one particular point as the origin, and obtained an x'- and y'- vector, based on some features. This also means I can obtain the z'-vector by taking cross product of x' and y'.
I would like to rotate all these points, such that the x'-, y'- and z'- are in line with the x-, y- and z- axes respectively.
An example of the vectors to be mapped would be say:
x': [-0.2831 -0.9246 0.2548]'
y': [0.9242 -0.1919 0.3303]'
How do I obtain a rotation matrix to be applied to all my points? Thank you for your help!
  1 个评论
Walter Roberson
Walter Roberson 2017-7-24
Duplicated by later https://www.mathworks.com/matlabcentral/answers/349969-3d-rotation-matrix which appears to have been updated.

回答(1 个)

KSSV
KSSV 2017-7-24
If t is the angle by which you want to rotate your coordinates, the following are the rotation matrices.
Along X:
Rx = [1 0 0; 0 cos(t) -sin(t) ; 0 sin(t) cos(t)] ;
Along Y:
Ry = [cos(t) 0 sin(t) ; 0 1 0 ; -sin(t) 0 cos(t)] ;
Along Z axes:
Rz = [cos(t) -sin(t) 0 ; sin(t) cos(t) 0 ; 0 0 1] ;

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by