1 function rx = vecrotx(angle)
3 % VECROTX: Transformation matrix for a rotation around the x axis.
11 % angle : rotation angle defined in radians
15 % rx : (4x4) Transformation matrix.
20 % Return the (4x4) Transformation matrix for a rotation about the x axis
21 % by the defined angle.
26 % [ 0 cos(angle) -sin(angle) 0]
27 % [ 0 sin(angle) cos(angle) 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 = vecrotx(%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 rx = [1 0 0 0; 0 cn -sn 0; 0 sn cn 0; 0 0 0 1];