


compute the Feret diameter for a H-polytope in given direction Syntax: diameter = computeFeretVrep(vrep, dirMatrix) This function calculates the Feret diameter for all directions in dirMatrix that contains one direction in each row. The Feret diameter is the 1-dimensional volume of the projection of the polytope onto a line with the given direction. By this definition the Feret diameter is also known as quermass like the projection area. computeFeretVrep(..., zerotol) allows to set the tolerance for underlying algorithms. Default: elkZerotol See also: computeFeretVrep, computeProjectionAreaHrep, computeVolumeHrep, computeSupportValueHrep, computeFacetAreaHrep


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