Home > vbmeg > functions > leadfield > sphere > vb_make_fullsphere.m

vb_make_fullsphere

PURPOSE ^

Make vertex points on a sphere

SYNOPSIS ^

function [F,V,Jlist,NDlist,Ahead] = vb_make_fullsphere(Nsphere)

DESCRIPTION ^

 Make vertex points on a sphere
  [F,V] = vb_make_fullsphere(Nsphere)
  [F,V,Jlist,NDlist,Ahead] = vb_make_fullsphere(Nsphere)
 球面三角分割
 --- Input
 Nsphere  : Number of desired points
 --- Output
 F(m,1:3) : triangle vertex index for m-th triangle
 V(n,1:3) : (x,y,z) coordinate for n-th vertex
 --- optional output
 Ahead(m) : area of m-th triangle
 Jlist{n}  : theta(n) に対応する点のインデックス
 NDlist(n) : Jlist{n} の点数

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function    [F,V,Jlist,NDlist,Ahead] = vb_make_fullsphere(Nsphere)
0002 % Make vertex points on a sphere
0003 %  [F,V] = vb_make_fullsphere(Nsphere)
0004 %  [F,V,Jlist,NDlist,Ahead] = vb_make_fullsphere(Nsphere)
0005 % 球面三角分割
0006 % --- Input
0007 % Nsphere  : Number of desired points
0008 % --- Output
0009 % F(m,1:3) : triangle vertex index for m-th triangle
0010 % V(n,1:3) : (x,y,z) coordinate for n-th vertex
0011 % --- optional output
0012 % Ahead(m) : area of m-th triangle
0013 % Jlist{n}  : theta(n) に対応する点のインデックス
0014 % NDlist(n) : Jlist{n} の点数
0015 %
0016 % Copyright (C) 2011, ATR All Rights Reserved.
0017 % License : New BSD License(see VBMEG_LICENSE.txt)
0018 
0019 Pos.theta_min  = -0.5*pi;
0020 Pos.theta_max  = 0.5*pi;
0021 Pos.phi_min    = 0;
0022 Pos.phi_max    = 2*pi;
0023 Pos.r           = 1;                
0024 
0025 %resol    = sqrt(7.5*pi/(Nsphere));
0026 %Ntheta    = fix(pi/(2*resol));
0027 %Nphi    = fix(2*pi/resol);
0028 
0029 [Ntheta, Nphi, Nall ] = vb_calc_sphere_point_num(Nsphere);
0030 
0031 Pos.Ntheta       = Ntheta;
0032 Pos.Nphi       = Nphi    ;
0033 
0034 [x, NDlist, Jlist] = vb_make_sphere_point(Pos);    % Cortex point
0035 
0036 F = vb_make_triangle(Jlist);
0037 %make_triangle2;
0038 
0039 V = x(:,1:3);
0040 
0041 if nargout < 3, return; end
0042 
0043 %xx = x(:,4:6);
0044 
0045 %%%%% DEBUG
0046 % NDlist
0047 %for j=1:3
0048 %    Jlist{j};
0049 %end
0050 %
0051 %NF=22;
0052 %F(1:NF,:);
0053 %%%%% DEBUG
0054 
0055 Npoint = size(V,1);
0056 Npatch = size(F,1);
0057 Ahead  = zeros(Npatch,1);
0058 
0059 for i=1:Npatch,
0060     xpl      = vb_cross2(V(F(i,2),:)-V(F(i,1),:), ...
0061                       V(F(i,3),:)-V(F(i,1),:));
0062     Ahead(i) = sqrt(xpl*xpl')/2;      % patche area by cross product
0063 end
0064 
0065 Amean = sum(Ahead)/Npatch;
0066 Amax  = max(Ahead);
0067 Amin  = min(Ahead);
0068 Aimg  = sum(abs(imag(Ahead)));
0069

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005