フィルターのクリア

vector projection on rotated coordinate system

8 ビュー (過去 30 日間)
UWM
UWM 2019 年 12 月 27 日
コメント済み: UWM 2019 年 12 月 27 日
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

採用された回答

Matt J
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;
  1 件のコメント
UWM
UWM 2019 年 12 月 27 日
It works. Thank you.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by