🌎Geodaisy - simple geodesic utilities for NodeJS and Web
Get started
npm install geodaisy
Usage in JavaScript or TypeScript (typings are available):
Distance utilities - Haversine
Uses the Haversine Formula to calculate the distance between two earthly points of coordinates.
; ; ; ; console.logdistance; // > 6769.949658450232
Distance utilities - distanceWithLatitude
Given a distance as a number (this formula does not care about units) and the distance between the elevation change between two points - calculates the real distance between the two points in a straight line, e.g.:
; ; // m; // m ; console.logrealDistance; // > 13845.374678931588
Conversion utilities
The following conversion utilities are also available:
; console.logkmToMile1; // > 0.621371console.logmileToKm1; // > 1.6093444978925633console.logyardToMetre1; // > 0.9144console.logmetreToYard1; // > 1.0936132983377078console.loginchToCm1; // > 2.54console.logcmToInch1; // > 0.39370078740157477
Missing features
The following features I'd love to have in this library but just don't have the time to implement yet. If you'd like to help, feel free to contribute!
- Bearing calculation
- Destination point calculation
- Intersection calculation
- Path finding
- Closest point to the poles
- Rhumb lines
- Vincenty's formula