


Obtain the V-representation of an approximized two-dimensional circle This is a subfunction used by obtainVrep. Use obtainVrep instead. See also: obtainVRep, obtainHRep


0001 function vrep = obtainCircle(n) 0002 % Obtain the V-representation of an approximized two-dimensional circle 0003 % 0004 % This is a subfunction used by obtainVrep. Use obtainVrep instead. 0005 % 0006 % See also: obtainVRep, obtainHRep 0007 0008 % The elk-library: convex geometry applied to crystallization modeling. 0009 % Copyright (C) 2012 Alexander Reinhold 0010 % 0011 % This program is free software: you can redistribute it and/or modify it 0012 % under the terms of the GNU General Public License as published by the 0013 % Free Software Foundation, either version 3 of the License, or (at your 0014 % option) any later version. 0015 % 0016 % This program is distributed in the hope that it will be useful, but 0017 % WITHOUT ANY WARRANTY; without even the implied warranty of 0018 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0019 % General Public License for more details. 0020 % 0021 % You should have received a copy of the GNU General Public License along 0022 % with this program. If not, see <http://www.gnu.org/licenses/>. 0023 0024 % divide perigon into n pieces 0025 phi = 0:2*pi/n:(2*pi*(n-1)/n); 0026 0027 % approximate circle by regular polygon with n-edges 0028 vrep.V = [cos(phi)', sin(phi)'];