vector projection on rotated coordinate system
조회 수: 9 (최근 30일)
이전 댓글 표시
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
채택된 답변
Matt J
2019년 12월 27일
편집: Matt J
2019년 12월 27일
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개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!