-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathrotZ.m
28 lines (23 loc) · 1015 Bytes
/
rotZ.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function C_z = rotZ(alpha)
%‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
% ROTZ Basic rotation about z-axis by an angle alpha.
%
% INPUT:
% * alpha, angle scalar [rad]
%
% OUTPUT:
% * C, Coordinate transformation matrix (3 x 3) matrix []
%
% Author: Livio Bisogni
%_______________________________________________________________________________________________________
% Check number of arguments
narginchk(1,1);
if (~isscalar(alpha))
error('alpha must be a scalar.');
end
ca = cos(alpha);
sa = sin(alpha);
C_z = [ca, sa, 0;
-sa, ca, 0;
0, 0, 1];
end