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

📄 ry.m

📁 Matlab下的EEG处理程序库
💻 M
字号:
function [XYZ] = Ry(XYZ,b,units)

% Ry - Rotate 3D Cartesian coordinates around the Y axis
%
% Useage:   [XYZ] = Ry(XYZ,beta,units)
%
% XYZ is a [3,N] or [N,3] matrix of 3D Cartesian coordinates
%
% 'beta'  - angle of rotation about the Y axis
% 'units' - angle is either 'degrees' or 'radians'
%           the default is beta in radians
% 
% If input XYZ = eye(3), the XYZ returned is
% the rotation matrix.
% 
% See also Rx Rz
%

% $Revision: 1.2 $ $Date: 2003/03/02 03:20:43 $

% Licence:  GNU GPL, no express or implied warranties
% History:  04/2002, Darren.Weber@flinders.edu.au
%                    Developed after example 3.1 of
%                    Mathews & Fink (1999), Numerical
%                    Methods Using Matlab. Prentice Hall: NY.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if ~exist('units','var'), units = 'radians'; end

% convert degrees to radians
if isequal(units,'degrees'),
    b = b*pi/180;
end

Ry = [ cos(b) 0 sin(b); 0 1 0; -sin(b) 0 cos(b) ];

if isequal(size(XYZ,1),3),
    XYZ = Ry * XYZ;
else
    XYZ = XYZ';
    if isequal(size(XYZ,1),3),
        XYZ = [Ry * XYZ]';
    else
        error('Ry: Input XYZ must be [N,3] or [3,N] matrix.\n');
    end
end

return

⌨️ 快捷键说明

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