Skip to main content

ResQ.Core.Location

Location.DistanceTo(Location) Method

Calculates the great-circle distance to another location using the Haversine formula.

Parameters

other Location The target location to calculate distance to.

Returns

System.Double
The distance in kilometers between this location and the target.

Example

Remarks

This method uses the Haversine formula to calculate the shortest distance over the earth’s surface, giving an “as-the-crow-flies” distance between the points (ignoring any hills, valleys, or other obstacles). The calculation assumes a spherical earth with a radius of 6,371 kilometers.