laserbeam

PURPOSE ^

function [sel] = laserbeam(vtx,srf,cnts)

SYNOPSIS ^

function [sel] = laserbeam(vtx,srf,cnts)

DESCRIPTION ^

 function [sel] = laserbeam(vtx,srf,cnts)

 Auxiliary ploting function, to assist in assigning surface patches
 as electrodes. 



vtx  = The vertices matrix
srf  = The boundary faces 
cnts = The coordinates of the centers of the surfaces

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [sel] = laserbeam(vtx,srf,cnts)
0002 % function [sel] = laserbeam(vtx,srf,cnts)
0003 %
0004 % Auxiliary ploting function, to assist in assigning surface patches
0005 % as electrodes.
0006 %
0007 %
0008 %
0009 %vtx  = The vertices matrix
0010 %srf  = The boundary faces
0011 %cnts = The coordinates of the centers of the surfaces
0012 
0013 
0014 p = get(gca,'CurrentPoint');
0015 
0016 pnear = p(1,:);
0017 
0018   
0019    x1 = pnear(1)*ones(size(cnts,1),1);     
0020    y1 = pnear(2)*ones(size(cnts,1),1);     
0021    z1 = pnear(3)*ones(size(cnts,1),1);
0022    x2 = cnts(:,1); 
0023    y2 = cnts(:,2); 
0024    z2 = cnts(:,3);
0025    
0026 [dista] = db23d(x1,y1,z1,x2,y2,z2);
0027 
0028 
0029 [mv,sel] = min(dista);
0030 
0031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0032 % This is part of the EIDORS suite.
0033 % Copyright (c) N. Polydorides 2003
0034 % Copying permitted under terms of GNU GPL
0035 % See enclosed file gpl.html for details.
0036 % EIDORS 3D version 2.0
0037 % MATLAB version 5.3 R11
0038 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Generated on Tue 09-Aug-2011 11:38:31 by m2html © 2005