moveVrep

PURPOSE ^

move the polytope in V-representation along a vector

SYNOPSIS ^

function vrep = moveVrep(vrep, v)

DESCRIPTION ^

 move the polytope in V-representation along a vector

 Syntax: Vrep = moveVrep(Vrep, v)

 The vector v must be a vector that matches the dimension of the polytope 
   Vrep.

 See also: movePolytope, obtainPolytope, stretchPolytope, rotatePolytope

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function vrep = moveVrep(vrep, v)
0002 % move the polytope in V-representation along a vector
0003 %
0004 % Syntax: Vrep = moveVrep(Vrep, v)
0005 %
0006 % The vector v must be a vector that matches the dimension of the polytope
0007 %   Vrep.
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 row vector
0028 if size(v, 2) == 1
0029     v = v';
0030 end
0031 
0032 if length(v) ~= size(vrep.V, 2)
0033     error('elk:polytope:wrongType', ...
0034         'dimension of the vector must match the dimension of the polytope');
0035 end
0036 
0037 %% Result for convex hull object
0038 vrep.V = vrep.V + ones(size(vrep.V, 1), 1)*v;
0039 
0040 end

Generated on Sat 18-Jul-2015 16:45:31 by m2html © 2005