0001 function [Ntheta, Nphi, Nall ] = vb_calc_sphere_point_num(Nsphere)
0002
0003
0004
0005
0006
0007 theta_min = -0.5*pi;
0008
0009 mode = 1;
0010 resol = sqrt(6*pi/(Nsphere));
0011 Nmax = 2*fix(pi/(2*resol));
0012
0013 Ltheta = 2*[1:Nmax];
0014 Lphi = zeros(Nmax,1);
0015 Lall = zeros(Nmax,1);
0016
0017 for n = 3:Nmax
0018 Ntheta=2*n;
0019
0020 step = pi/Ntheta;
0021
0022 Nphi = fix(2*pi/step);
0023
0024 theta = step*[1:Ntheta-1] + theta_min;
0025
0026 Nall = sum( 2*fix( Nphi*cos(theta)/2 ) ) + 2;
0027
0028 Lphi(n)=Nphi;
0029 Lall(n)=Nall;
0030
0031 if Nall > Nsphere, break; end;
0032
0033 end
0034
0035 if mode == 0
0036 [dmin,ix] = min(abs( Lall - Nsphere ));
0037 else
0038 ix = n;
0039 end
0040
0041 Nall = Lall(ix);
0042 Ntheta = Ltheta(ix);
0043 Nphi = Lphi(ix);