


move the polytope in H-representation along a vector Syntax: hrep = moveHrep(hrep, v) The vector v must be a vector that matches the dimension of the polytope Hrep. See also: movePolytope, obtainPolytope, stretchPolytope, rotatePolytope


0001 function hrep = moveHrep(hrep, v) 0002 % move the polytope in H-representation along a vector 0003 % 0004 % Syntax: hrep = moveHrep(hrep, v) 0005 % 0006 % The vector v must be a vector that matches the dimension of the polytope 0007 % Hrep. 0008 % 0009 % See also: movePolytope, obtainPolytope, stretchPolytope, rotatePolytope 0010 0011 % The elk-library: convex geometry applied to crystallization modeling. 0012 % Copyright (C) 2012 Alexander Reinhold 0013 % 0014 % This program is free software: you can redistribute it and/or modify it 0015 % under the terms of the GNU General Public License as published by the 0016 % Free Software Foundation, either version 3 of the License, or (at your 0017 % option) any later version. 0018 % 0019 % This program is distributed in the hope that it will be useful, but 0020 % WITHOUT ANY WARRANTY; without even the implied warranty of 0021 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0022 % General Public License for more details. 0023 % 0024 % You should have received a copy of the GNU General Public License along 0025 % with this program. If not, see <http://www.gnu.org/licenses/>. 0026 0027 %% correct v to be a column vector 0028 if size(v, 1) == 1 0029 v = v'; 0030 end 0031 0032 if length(v) ~= size(hrep.A, 2) 0033 error('elk:polytope:wrongType', ... 0034 'dimension of the vector must match the dimension of the polytope'); 0035 end 0036 0037 hrep.h = hrep.h + hrep.A*v; 0038 end