NAME:
neighbor
PURPOSE:
find the closetest point of (P0) within a list of np1 points
P1 Which can be on a sphere
CATEGORY:
Maps.
CALLING SEQUENCE:
Result = neighbor(lon0, lat0, lon1, lat1)
INPUTS:
Lon0, Lat0 = scalar. longitudes and latitudes of point P0.
Lon1, Lat1 = np1 elements vector. longitude and latitude of
np1 points P1
KEYWORD PARAMETERS:
RADIANS = if set, inputs and angular outputs are in radians, otherwise
degrees.
DISTANCE = dis, to get back the distances between P0 and the np1
points P1 in the variable dis.
/SPHERE to activate if points are located on a sphere.
OUTPUTS:
index giving the P1[index] point that is the closetest point
of (P0)
EXAMPLES:
IDL> print, neighbor(-105.15,40.02,[-0.07,100,50],[51.30,20,0], $
distance=dis)
0
IDL> print, dis
105.684 206.125 160.228
MODIFICATION HISTORY: