1 function ss = vecscale(vector)
4 % VECSCALE: Transformation matrix for a scaling.
12 % svec : A vectors defining the scaling along the x,y and z axes.
17 % ss : Scaling Transformation Matrix
21 % Returns a (4x4) Transformation matrix for scaling.
32 % Scale up the NURBS line (0.0,0.0,0.0) - (1.0,1.0,1.0) by 3 along
33 % the x-axis, 2 along the y-axis and 4 along the z-axis.
35 % line = nrbline([0.0 0.0 0.0],[1.0 1.0 1.0]);
36 % trans = vecscale([3.0 2.0 4.0]);
37 % sline = nrbtform(line, trans);
43 % Copyright (C) 2000 Mark Spink, 2007 Daniel Claxton
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/>.
59 error('Scaling vector not specified');
63 ss = [s(1) 0 0 0; 0 s(2) 0 0; 0 0 s(3) 0; 0 0 0 1];