vector projection on rotated coordinate system
7 views (last 30 days)
Show older comments
I have to vectors: red (XR, YR, ZR) and blue (XB, YB, ZB) in XYZ coordinate
system. I would like to calculate projection of these two vectors on X'Y', X'Z' and Y'Z' planes
where X'Y'Z' is rotaded, along Z (angle 'alpha') and Y (angle 'beta') axises, coordinate system XYZ.
Vectors stay in old XYZ system (are not rotated). Only system is rotaded along two axisies.
Any suggestions how this could be done?
0 Comments
Accepted Answer
Matt J
on 27 Dec 2019
Edited: Matt J
on 27 Dec 2019
I'll assume your given vectors are in a 3x2 matrix called columnVectors, that your angles are in degrees, and that rotations are done in Z first and Y second.
Rz=@(x) [cosd(x),-sind(x),0 ; ...
sind(x),cosd(x),0 ;...
0 0 1];
Ry = @(x) [cosd(x), 0, sind(x); 0 1 0; -sind(x), 0, cosd(x) ];
R=Ry(beta)*Rz(alpha); %ANGLES ARE IN DEGREES!!
[XpYp,XpZp,YpZp]=deal(R.'*columnVectors);
XpYp(3,:)=0; %X'Y'
XpZp(2,:)=0; %X'Z'
YpZp(1,:)=0; %Y'Z'
XpYp=R*XpYp;
XpZp=R*XpZp;
YpZp=R*YpZp;
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!