rotation_matrix.m

来自「mimo在cost207信道下的链路的代码」· M 代码 · 共 56 行

M
56
字号
function T=rotation_matrix(alpha,beta,gamma);
% This function creates a rotation matrix for rotating objects around the
% three axes. 
%
% alpha .. rotation around the x-axis
% beta  .. rotation around the y-axis
% gamma .. rotation around the z-axis
%
% Copyright (C)2005  Helmut Hofstetter
% 
%  This program is free software; you can redistribute it and/or modify
%  it under the terms of the GNU General Public License as published by
%  the Free Software Foundation; either version 2 of the License, or
%  (at your option) any later version.
% 
%  This program is distributed in the hope that it will be useful,
%  but WITHOUT ANY WARRANTY; without even the implied warranty of
%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%  GNU General Public License for more details.
% 
%  You should have received a copy of the GNU General Public License
%  along with this program; if not, write to the Free Software
%  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
% 
%----------------------------------------------------------------------%
%                                                                      %
%              Author: Helmut Hofstetter <hofstetter@ftw.at>           %
%             Created: 25/05/2005 by HH                                %
%   Last modification: 18/08/2005 by HH                                %
%        Organization: Telecommunications Research Center Vienna,      %
%                      Tech Gate Vienna,                               %
%                      Donau-City Str. 1 / 3rd floor,                  %
%                      A-1220 Vienna, Austria.                         %
%             Project: FTW C9 "MIMO UMTS for future packet services"   %
%    Deliverable Type: This M-file is public available                 %
%                 URL: http://www.ftw.at/cost273/                      %
%         Source Code: MATLAB v7.0 SP2                                 %
%             History:                                                 %
%             Created: 1.00, 25/05/2005 by HH (ftw)                    %
%                                                                      %
%----------------------------------------------------------------------%

Tx=[1    0           0       ;...
    0  cos(alpha) -sin(alpha);...
    0  sin(alpha)  cos(alpha)];
        
Ty=[cos(beta) 0 sin(beta);...
       0     1   0     ;...
   -sin(beta) 0 cos(beta)];

Tz=[cos(gamma)  sin(gamma) 0 ;...
   -sin(gamma)  cos(gamma) 0 ;...
        0          0       1];

T=Tx*Ty*Tz;

⌨️ 快捷键说明

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