⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rotx_.m

📁 可以转动的风扇:rotx_.m,roty_.m,rotz_.m为旋转函数
💻 M
字号:
% rotx_.m
% rotx_(x,y,z,th) rotates a vector [x,y,z] 
% th degrees counter-clockwise about
% the x-axis.  See Appendix B; List B.1
function [xd,yd,zd]=rotx_(x,y,z,th)
cosf=cos(th*pi/180);sinf=sin(th*pi/180);
xd =x; 
yd =  cosf.*y - sinf.*z;
zd =  sinf.*y + cosf.*z;
plot3(x,y,z)

% % roty_.m
% % roty_(x,y,z,th) rotates a vector [x,y,z] 
% % th degrees counter-clockwise about
% % the y-axis.  See Appendix B; List B.1
% function [xd,yd,zd]=roty_(x,y,z,th)
% cosf=cos(th*pi/180);sinf=sin(th*pi/180);
% yd =y;
% xd =  cosf.*x + sinf.*z;
% zd = - sinf.*x + cosf.*z;
% %       
% % rotz_.m
% % rotz_(x,y,z,th) rotates a vector [x,y,z] 
% % th degrees counter-clockwise about
% % the z-axis.  See Appendix B; List B.1
% function [xd,yd,zd]=rotz_(x,y,z,phi)
% cosf=cos(phi*pi/180);sinf=sin(phi*pi/180); 
% xd =  cosf *x - sinf *y;
% yd = sinf *x + cosf *y;
% zd =z;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -