r1.m

来自「衛星軌道運算可算出課譜樂六元素的一個好程式」· M 代码 · 共 36 行

M
36
字号
%Rotation matrix direction cosine matrix
% Richard Rieber
% September 21, 2006
% rrieber@gmail.com
%
% Revision 8/21/07: Deleted unneeded ; in function name.
%                   Added example.
%                   Added H1 line for lookfor functionality
%
% function A = R1(x)
% 
% This function creates a rotation matrix about the 1-axis (or the X-axis)
%
% A = [1      0       0;
%      0      cos(x)  sin(x);
%      0      -sin(x) cos(x)];
%
% Inputs:  x - rotation angle in radians
% Outputs: A - the rotation matrix about the X-axis
%
% EXAMPLE:
%
% R1(pi/4) = 
%     1.0000         0         0
%          0    0.7071    0.7071
%          0   -0.7071    0.7071

function A = R1(x)

if nargin > 1
    error('Too many inputs.  See help file')
end

A = [1      0       0;
     0      cos(x)  sin(x);
     0      -sin(x) cos(x)];

⌨️ 快捷键说明

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