distance

fun distance(from: Position, to: Position, units: Units = Units.Kilometers): Double

Calculates the distance between two positions. This uses the Haversine formula to account for global curvature.

Return

distance between the two points in units

Parameters

from

origin point

to

destination point

units

units of returned distance

See also