DistanceBetweenTwoPoints

Compares two geographic points, each defined by a set of longitude and latitude values. The function returns the shortest distance between the two points, in metres. This value is known as the Geodesic distance between the points.

Syntax

DistanceBetweenTwoPoints( StartLatitude, StartLongitude, EndLatitude, EndLongitude );

Parameters

Parameter Name Type Description Optional? Default Value
StartLatitude String The latitude of the first point. No n/a
StartLongitude String The longitude of the first point. No n/a
EndLatitude String The latitude of the second point. No n/a
EndLongitude String The longitude of the second point. No n/a

Output

If successful, the function will return the shortest distance between the two points, in metres.

Use Case

The following expression will compare the latitude and longitude values of a static point with a set obtained using GetLocationInfo and return the distance between them, in metres:

GetLocationInfo( "VARCurrentLongitude", "VARCurrentLatitude");

DistanceBetweenTwoPoints( VARCurrentLatitude, VARCurrentLongitude, "55.948188", "-3.201189" );