


compute edge lengths of a H-polytope Syntax: edgeLength = computeFacetAreaVrep(vrep, dirMatrix) This function calculates a vector of edge lengths for all directions in dirMatrix (one direction in each row). The direction specifies a normal vector for the hyperplane to obtain the corresponding support set. The given direction for an edge must be normal to the edge and between the normal vectors of the adjacent facets. computeEdgeLengthVrep(..., zerotol) allows to set the tolerance for underlying algorithms (determining flat polytopes; default in elkZerotol). See also: computeEdgeLengthVrep, computeFacetAreaHrep, computeVolumeHrep, computeProjectionAreaHrep, computeFeretHrep, computeSupportValueHrep


0001 function edgeLength = computeEdgeLengthHrep(hrep, dirMatrix, zerotol) 0002 % compute edge lengths of a H-polytope 0003 % 0004 % Syntax: edgeLength = computeFacetAreaVrep(vrep, dirMatrix) 0005 % 0006 % This function calculates a vector of edge lengths for all directions 0007 % in dirMatrix (one direction in each row). The direction specifies a 0008 % normal vector for the hyperplane to obtain the corresponding support 0009 % set. The given direction for an edge must be normal to the edge and 0010 % between the normal vectors of the adjacent facets. 0011 % 0012 % computeEdgeLengthVrep(..., zerotol) allows to set the tolerance for 0013 % underlying algorithms (determining flat polytopes; default in 0014 % elkZerotol). 0015 % 0016 % See also: computeEdgeLengthVrep, computeFacetAreaHrep, computeVolumeHrep, 0017 % computeProjectionAreaHrep, computeFeretHrep, computeSupportValueHrep 0018 0019 % The elk-library: convex geometry applied to crystallization modeling. 0020 % Copyright (C) 2012 Alexander Reinhold 0021 % 0022 % This program is free software: you can redistribute it and/or modify it 0023 % under the terms of the GNU General Public License as published by the 0024 % Free Software Foundation, either version 3 of the License, or (at your 0025 % option) any later version. 0026 % 0027 % This program is distributed in the hope that it will be useful, but 0028 % WITHOUT ANY WARRANTY; without even the implied warranty of 0029 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0030 % General Public License for more details. 0031 % 0032 % You should have received a copy of the GNU General Public License along 0033 % with this program. If not, see <http://www.gnu.org/licenses/>. 0034 0035 %% Input handling 0036 % default zerotol 0037 if ~exist('zerotol', 'var') 0038 zerotol = elkZerotol; 0039 end 0040 0041 %% Calculating area 0042 % fall back to computeFacetAreaVrep 0043 vrep = convertHrepToVrep(hrep, zerotol); 0044 if ~isempty(vrep.V) 0045 edgeLength = computeEdgeLengthVrep(vrep, dirMatrix, zerotol); 0046 else 0047 edgeLength = 0; 0048 end