Home > hfrc > matlab > utility > lonlat2dist.m

lonlat2dist

PURPOSE ^

LONLAT2DIST - computes distance in kms between points.

SYNOPSIS ^

function d = lonlat2dist( c1, c2 )

DESCRIPTION ^

 LONLAT2DIST - computes distance in kms between points.

 Usage: dist = lonlat2dist( coords1, coords2 )

 coords1 and coords2 should have the lon, lat coordinates of the points
 you want the distance between.

 If coords1 and coords2 have the same size and shape, the distances
 between individual points will be computed.  If one of them is a 2xM
 size matrix and the other is a Nx2 size matrix, then the result will be
 a MxN matrix with the distances between all possible combinations of
 points.  Note that this system has problems precisely when one is
 dealing with 2 coordinate pairs.

 If coords2 is not given, it will be set to coords1'

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

     $Id: lonlat2dist.m,v 1.6 2003-10-02 00:03:04 dmk Exp $    

 Copyright (C) 2001 David M. Kaplan
 Licence: GPL

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Mon 18-Dec-2006 07:26:46 by m2html © 2003