Info
This question is closed. Reopen it to edit or answer.
3D Rotation Matrix
12 views (last 30 days)
Show older comments
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 Comment
Walter Roberson
on 24 Jul 2017
Duplicated by later https://www.mathworks.com/matlabcentral/answers/349969-3d-rotation-matrix which appears to have been updated.
Answers (1)
KSSV
on 24 Jul 2017
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] ;
0 Comments
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!