GeoCoordinate.GetDistanceTo(GeoCoordinate) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the distance between the latitude and longitude coordinates that are specified by this GeoCoordinate and another specified GeoCoordinate.
public:
double GetDistanceTo(System::Device::Location::GeoCoordinate ^ other);
public double GetDistanceTo (System.Device.Location.GeoCoordinate other);
member this.GetDistanceTo : System.Device.Location.GeoCoordinate -> double
Public Function GetDistanceTo (other As GeoCoordinate) As Double
Parameters
- other
- GeoCoordinate
The GeoCoordinate for the location to calculate the distance to.
Returns
The distance between the two coordinates, in meters.
Remarks
The Haversine formula is used to calculate the distance. The Haversine formula accounts for the curvature of the earth, but assumes a spherical earth rather than an ellipsoid. For long distances, the Haversine formula introduces an error of less than 0.1 percent.
Altitude is not used to calculate the distance.