-
distanceSort(lat, lon, points) → {array}
-
Given a point and a list of points, returns the list sorted by distance (closest first)
Parameters:
Name Type Description lat
mixed Lat of center point or array of
[lat, lon]
representing the center pointlon
mixed Lon of center point or array of points to sort
points
array Array of points to sort
Returns:
Array of points, sorted by distance from center point, with the distance pushed as the last element in each array
- Type
- array
-
haversine(lat1, lon1, lat2, lon2) → {number}
-
Compute the distance between two points using the haversine formula, based on the above defined Radius.
Parameters:
Name Type Argument Description lat1
mixed First lat, or an array of
[lat, lon]
representing the first pointlon1
mixed First lon, or an array of
[lat, lon]
resresenting the second pointlat2
number <optional>
The latitude of the second point
lon2
number <optional>
The longitude of the second point
Returns:
The distance, in KM, between the two points, rounded to the tenths.
- Type
- number
-
toRad(num) → {number}
-
Give that trig function a radian. Trig functions LOVE radians
Parameters:
Name Type Description num
number Angle, in degrees to return as a Radian
Returns:
The radian for that angle.
- Type
- number
Maintenance
Commit Frequency
Further analysis of the maintenance status of haversort based on released npm versions cadence, the repository activity, and other data points determined that its maintenance is Inactive.
An important project maintenance signal to consider for haversort is that it hasn't seen any new versions released to npm in the past 12 months, and could be considered as a discontinued project, or that which receives low attention from its maintainers.
In the past month we didn't find any pull request activity or change in issues status has been detected for the GitHub repository.