vector projection on rotated coordinate system

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?
rotation.jpg

 采纳的回答

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;

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Cartesian Coordinate System Conversion 的更多信息

提问:

UWM
2019-12-27

评论:

UWM
2019-12-27

Community Treasure Hunt

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

Start Hunting!

Translated by