BIRDy/Utils/MathTools/RotZ.m

20 lines
340 B
Mathematica
Raw Permalink Normal View History

2021-04-29 09:42:38 +00:00
function [ Rz ] = RotZ(gammaZ, degrad)
% Authors: Quentin Leboutet, Julien Roux, Alexandre Janot and Gordon Cheng
%
% Returns the rotation matrix around the Z axis with angle gammaZ.
if nargin > 1 && strcmp(degrad, 'deg')
gammaZ = gammaZ *pi/180;
end
cg=cos(gammaZ);
sg=sin(gammaZ);
Rz=[cg -sg 0;
sg cg 0;
0 0 1];
end