Click or drag to resize

LongLatDistanceTo Method

Returns a Distance that represents the shortest distance along the surface of the Earth from this to the specified longLat.

Namespace: DegreeDays.Geo
Assembly: DegreeDays (in DegreeDays.dll) Version: 1.4
Syntax
public Distance DistanceTo(
	LongLat longLat
)

Parameters

longLat  LongLat
The geographic position to which the distance from this should be measured.

Return Value

Distance
The Distance that represents the shortest distance along the surface of the Earth from this to the specified longLat.
Remarks

The returned distance will be measured in metres, but it's easy to convert it into other units. For example:

Distance londonToNewYorkInMiles = london.DistanceTo(newYork).InMiles();

In practical terms, a.DistanceTo(b) will be equal to b.DistanceTo(a), but the values often won't be exactly equal because of small inaccuracies in the floating-point arithmetic that this method uses to calculate the distance between positions.

See Also