distance library

Functions

calculateRhumbDistance(Position origin, Position destination, [num radius = earthRadius]) num
Returns the distance travelling from ‘this’ point to destination point along a rhumb line. Adapted from Geodesy ‘distanceTo‘: https://github.com/chrisveness/geodesy/blob/master/latlon-spherical.js
distance(Point from, Point to, [Unit unit = Unit.kilometers]) num
Calculates the distance between two Points in degrees, radians, miles, or kilometers. This uses the Haversine formula to account for global curvature. For example:
distanceRaw(Position from, Position to, [Unit unit = Unit.kilometers]) num
rhumbDistance(Point from, Point to, [Unit unit = Unit.kilometers]) num
Calculates the distance along a rhumb line between two Point in degrees, radians, miles, or kilometers.