nearxy
PURPOSE 
NEARXY finds the indices of (x,y) that are closest to the point (x0,y0).
SYNOPSIS 
function [index,distance]=nearxy(x,y,x0,y0,dist);
DESCRIPTION 
CROSS-REFERENCE INFORMATION 
This function calls:
This function is called by:
- sp2gc SP2GC State Plane (or whatever coordinates the model
- sp2gc2 SP2GC State Plane (or whatever coordinates the model
SOURCE CODE 
0001 function [index,distance]=nearxy(x,y,x0,y0,dist);
0002
0003
0004
0005
0006
0007
0008
0009 distance=sqrt((x-x0).^2+(y-y0).^2);
0010 if (nargin > 4),
0011 index=find(distance<=dist);
0012 else,
0013 index=find(distance==min(distance));
0014 index=index(1);
0015 end
0016 distance=distance(index);
Generated on Thu 01-Dec-2005 08:50:35 by m2html © 2003