Home > eeg > egis > net_utils > twod_pos.m

twod_pos

PURPOSE ^

SYNOPSIS ^

function twod_dist = twod_pos(xelec,yelec,zelec,radius)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function twod_dist = twod_pos(xelec,yelec,zelec,radius)
0002 
0003 [az,el,r] = cart2sph(xelec,yelec,zelec);
0004 
0005 el = pi*ones(size(el,1),size(el,2))/2 - el;
0006 
0007 icount = 1
0008 for i = 1:size(xelec,2)
0009     for j = i:size(xelec,2)
0010         zeroptaz = az(i);
0011         zeroptel = el(i);
0012         azgood = az(j);
0013         elgood = el(j);
0014 
0015         abgdist = acos(cos(elgood).*cos(zeroptel)+sin(elgood).*sin(zeroptel).*cos(azgood - zeroptaz));
0016 
0017         abgdist = abgdist*radius;
0018 
0019         twod_dist(icount) = abgdist;
0020         icount = icount+1;
0021     end;
0022 end;
0023 
0024 
0025

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003