CoordinateGet_Distance_From_Coordinate(Coordinate) Method

Returns the distance from a target coordinate using spherical earth calculations. Use overload if ellipsoidal calculations are desired.

Definition

Namespace: CoordinateSharp
Assembly: CoordinateSharp (in CoordinateSharp.dll) Version: 3.1.1.1
XMLNS for XAML: Not mapped to an xmlns.
C#
public Distance Get_Distance_From_Coordinate(
	Coordinate target
)

Parameters

target  Coordinate
Coordinate

Return Value

Distance
Distance

Example

The following example demonstrates how to obtain the distance from a target coordinate using default spherical earth calculations.
C#
Coordinate coord = new Coordinate(25, 25);
Coordinate target = new Coordinate(28, 30);

//Get distance from target using default spherical calculations
Distance d = coord.Get_Distance_From_Coordinate(target);

Console.Writeline(d.Kilometers); //598.928622714691

See Also