1 function dd = vectrans(vector)
3 % VECTRANS: Transformation matrix for a translation.
11 % tvec : A vectors defining the translation along the x,y and
12 % z axes. i.e. [tx, ty, ty]
16 % st : Translation Transformation Matrix
20 % Returns a (4x4) Transformation matrix for translation.
31 % Translate the NURBS line (0.0,0.0,0.0) - (1.0,1.0,1.0) by 3 along
32 % the x-axis, 2 along the y-axis and 4 along the z-axis.
34 % line = nrbline([0.0 0.0 0.0],[1.0 1.0 1.0]);
35 % trans = vectrans([3.0 2.0 4.0]);
36 % tline = nrbtform(line, trans);
42 % Copyright (C) 2000 Mark Spink
44 % This program is free software: you can redistribute it and/or modify
45 % it under the terms of the GNU General Public License as published by
46 % the Free Software Foundation, either version 2 of the License, or
47 % (at your option) any later version.
49 % This program is distributed in the hope that it will be useful,
50 % but WITHOUT ANY WARRANTY; without even the implied warranty of
51 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52 % GNU General Public License for more details.
54 % You should have received a copy of the GNU General Public License
55 % along with this program. If not, see <http://www.gnu.org/licenses/>.
59 error('Translation vector required');
63 dd = [1 0 0 v(1); 0 1 0 v(2); 0 0 1 v(3); 0 0 0 1];