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

vb_make_halfsphere

PURPOSE ^

球面三角分割

SYNOPSIS ^

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

DESCRIPTION ^

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

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