Returns a
Distance that represents the shortest
distance along the surface of the Earth from
this to the
specified
longLat.
Namespace: DegreeDays.GeoAssembly: DegreeDays (in DegreeDays.dll) Version: 1.4
Syntax public Distance DistanceTo(
LongLat longLat
)
Public Function DistanceTo (
longLat As LongLat
) As Distance
Parameters
- longLat LongLat
- The geographic position to which the distance from
this should be measured.
Return Value
DistanceThe
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();
Dim londonToNewYorkInMiles As Distance = 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