>  Docs Center  >  Libraries  >  Daithi  >  GEO_DIST

GEO_DIST

GEO_DIST

Name


GEO_DIST

Purpose


This function returns the great circle distance (in km) between
two geographical points.

Category


Geographical

Calling Sequence


Result = GEO_DIST( Longitude1, Latitude1, Longitude2, Latitude2 )

Inputs


Longitude1: The scalar longitude, of type floating point, of
the first point. North is positive.
Latitude1: The scalar latitude, of type floating point, of the
first point. East is positive.
Longitude2: The scalar or vector longitude(s), of type floating
point, of the second point(s). North is positive.
Latitude2: The scalar or vector latitude(s), of type floating
point, of the second point(s). East is positive.

Keyword Parameters


SINGLE: Forces the calculation to be performed using single-
precision arithmetic (default is double).

Outputs


Result: Returns the great circle distance between Point 1 and
Point(s) 2.

Uses


CONSTANTS.pro

Procedure


The function uses the Haversine formula to calculate the
arclength between the points.

Example


Calculate the distance between Ottawa, ON (45.25N, 75.43W) and
Victoria, BC (48.25N, 123.22W).
results = geo_dist( -75.43, 45.25, -123.22, 48.25 )

Modification History


  Written by: Daithi A. Stone (stoned@uvic.ca), 2000-06-29.
Modified: DAS, 2000-07-06 (removed LENGTH.pro, added
DIMENSION.pro).
Modified: DAS, 2000-07-24 (added Degrad constant).
Modified: DAS, 2000-08-17 (coverted from Cosine to Haversine
Haversine formula, added SINGLE keyword).
Modified: DAS, 2002-08-12 (complies with CONSTANTS.pro revision)



© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us