CapyKit/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_GetDistance_1.md
2024-04-22 21:27:51 -05:00

2.3 KiB

GetDistance(Double, Double, Double, Double, MeasurementSystem) Method

Gets the distance between two points on earth using the haversine formula.

Definition

Namespace: CapyKit.Helpers
Assembly: CapyKit (in CapyKit.dll) Version: 1.0.0

C#

public static double GetDistance(
	double latitudeOrigin,
	double longitudeOrigin,
	double latitudeDestination,
	double longitudeDestination,
	MeasurementSystem measurementSystem = MeasurementSystem.Imperial
)

F#

static member GetDistance : 
        latitudeOrigin : float * 
        longitudeOrigin : float * 
        latitudeDestination : float * 
        longitudeDestination : float * 
        ?measurementSystem : MeasurementSystem 
(* Defaults:
        let _measurementSystem = defaultArg measurementSystem MeasurementSystem.Imperial
*)
-> float 

Parameters

  Double
The latitude of the origin.
  Double
The longitude of the origin.
  Double
The latitude destination.
  Double
The longitude destination.
  MeasurementSystem  (Optional)
(Optional) The measurement system.

Return Value

Double
The distance.

Remarks

Uses the

haversine formula to calculate the "as-the-crow-flies" distance between two points on earth.

See Also

Reference

CalculationHelper Class
GetDistance Overload
CapyKit.Helpers Namespace