CoordinateGet_Distance_From_Coordinate(Coordinate, Shape) Method

Returns the distance from a target coordinate.

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,
	Shape shape
)

Parameters

target  Coordinate
Target coordinate
shape  Shape
Earth shape

Return Value

Distance
Distance

Example

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

//Get distance from target using ellipsoidal calculations
Distance d = coord.Get_Distance_From_Coordinate(target, Shape.Ellipsoid);

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

See Also