GpsTools v2.20 and later|
Calculates distance between two Position objects. The Method parameter determines how the
distance is calculated.
Method = 1, Great Circle Distance (in Meters)
If you are unsure about which method to use, then use this method. You will always get an
accurate result over short and long distances.
Earths radius is assumed to be 6,366,710 meters, which results in a nautical mile of 1852 meters.
This method is typically used at sea and air.
Method = 2, Great Circle Distance (in Radians)
The distance is returned in radians. This value should be multiplied by a Earth radius of choice.
Use this method if the standard radius in Method 1 is not what you want.
For instance, the former FAI standard for aviation records used the "FAI
sphere" with radius 6,371,000 meters.
Method = 3, Pythagoras theorem (in Meters)
Use this method if you want to calculate the distance on a grid. Typically used on land maps.
Dim objPos1 As New GpsToolsNET.Position
Dim objPos2 As New GpsToolsNET.Position
Dim distance_in_meters As Double
' Some position
objPos1.Longitude = 50.5
objPos1.Latitude = 40.75
' Some other position
objPos2.Latitude = 30
objPos2.Longitude = 20
' Distance from objPos1 to objPos2
' using Great Circle Distance calculation
distance_in_meters = objPos1.Distance(objPos2,
See also Shape.Distance and Position.Bearing
v = object.Distance(Position2, Method)
||An object that evaluates to an GpsToolsNET.Position object.
||Second object to calculate distance to.
||Method used to calculate distance.
100% managed code