CapyKit/Documentation/Help/M_CapyKit_Helpers_CalculationHelper_GetDistance.md
2024-09-04 19:31:43 -05:00

2.4 KiB

GetDistance(Decimal, Decimal, Decimal, Decimal, 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.2

C#

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

F#

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

Parameters

  Decimal
The latitude origin.
  Decimal
The longitude origin.
  Decimal
The latitude destination.
  Decimal
The longitude destination.
  MeasurementSystem  (Optional)
(Optional) The measurement system.

Return Value

Decimal
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
GetDistance(Double, Double, Double, Double, MeasurementSystem)