GetDistance()

Summary

Computes the great circle distance between two coordinates.

Syntax

dist = GetDistance(coordinate c1, coordinate c2)

Argument Contents
c1 First coordinate
c2 Second coordinate

Returns

A real number indicating the distance in the current map units (e.g., miles).

Example

loc1 = Coord(-120000000, 45000000)
loc2 = Coord(-95000000, 37500000)
dist = GetDistance(loc1, loc2)
ShowMessage("The distance is " + String(dist) + " " + GetMapUnits())

See Also

Function Summary
Azimuth() Computes the azimuth (heading) for a line between two points
GetLineDistance() Finds the distance from a coordinate to a line
GetMapUnits() Gets the current map measurement units
Heading() Returns the azimuth of the AB or BA direction of a line
SetMapUnits() Sets the current map measurement unit