1 function rz = vecrotz(angle)
3 % VECROTZ: Transformation matrix for a rotation around the z axis.
11 % angle : rotation angle defined in radians
15 % rz : (4x4) Transformation matrix.
20 % Return the (4x4) Transformation matrix for a rotation about the z axis
21 % by the defined angle.
25 % [ cos(angle) -sin(angle) 0 0]
26 % [ -sin(angle) cos(angle) 0 0]
32 % Rotate the NURBS line (0.0 0.0 0.0) - (3.0 3.0 3.0) by 45 degrees
35 % line = nrbline([0.0 0.0 0.0],[3.0 3.0 3.0]);
36 % trans = vecrotz(%pi/4);
37 % rline = nrbtform(line, trans);
43 % Copyright (C) 2000 Mark Spink
45 % This program is free software: you can redistribute it and/or modify
46 % it under the terms of the GNU General Public License as published by
47 % the Free Software Foundation, either version 2 of the License, or
48 % (at your option) any later version.
50 % This program is distributed in the hope that it will be useful,
51 % but WITHOUT ANY WARRANTY; without even the implied warranty of
52 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53 % GNU General Public License for more details.
55 % You should have received a copy of the GNU General Public License
56 % along with this program. If not, see <http://www.gnu.org/licenses/>.
60 rz = [cn -sn 0 0; sn cn 0 0; 0 0 1 0; 0 0 0 1];