ph_latlongdist PowerHome formula function
Description
Determines the straight line distance between two latitude/longitude points.
Syntax
ph_latlongdist ( lat1, long1, lat2, long2 )
Argument Description
lat1 Double. The latitude for point 1.
long1 Double. The longitude for point 1.
lat2 Double. The latitude for point 2.
long2 Double. The longitude for point2.
Return value
Double. The distance between the two points is returned in kilometers.
Usage
The lat/long values must be entered in pure decimal format. Northern latitudes are entered as a positive number, southern latitudes as a negative number. Eastern longitudes are a positive number, western longitudes are a negative number.
Examples
The following examples demonstrate typical syntax/usage for this function.
ph_latlongdist(28.6761,-81.5106,27.9710,-82.4650)
The above example calculates the distance between Apopka, Florida and Tampa, Florida. The returned value will be: 121.9592661764512 kilometers.