function dist = atomdis(names,coord,atom1,atom2)
%  Find the distance between two atoms given their names.
%
%  $BEGIN
%  $HEADER atomdis
%
%  Find the distance between two atoms given their names.
%  Returns -1 if no name is found.
%
%  $HEADER REFERENCE
%
%  $HEADER PROGRAMMER
%  John W. Craft, Jr.
%  University of Houston, (2005)
%
%  $HEADER VERSION
%  1.0.0
%
%  Example
%  distance = atomdis(names_list,coordinates,atom1,atom2)
%
%  See Also atomfind
%  
%  $END
%

first = atomfind(names,atom1);
second = atomfind(names,atom2);

dist = norm(coord(first,:)-coord(second,:))

return

