@neiderruiz/calculate-distance-coordinates
v1.0.2
Published
calculate distance between two coordinates
Downloads
6
Maintainers
Readme
🚀 Welcome calculate distance coordinates!
Install in project
npm i @neiderruiz/calculate-distance-coordinates
import { getDistanceBetweenPoints } from "@neiderruiz/calculate-distance-coordinates";
or
const { getDistanceBetweenPoints } = require("@neiderruiz/calculate-distance-coordinates");
usign
const firstCoordinate = { latitude: 52.4, longitude: 18.7 }
const secondCoordenate = { latitude: 52.6, longitude: 18.3 }
//default kilometers
const distanceKilometers = getDistanceBetweenPoints(firstCoordinate,secondCoordenate)
// meters
const distanceMeters = getDistanceBetweenPoints(firstCoordinate,secondCoordenate, 'm')
// hectometro
const distanceHectometers = getDistanceBetweenPoints(firstCoordinate,secondCoordenate, 'hm')
- List all types distances
- Kilometers: km
- Hectometers: hm
- Decameters: dam
- Meters: m
- Decimeters: dm
- Centimeters: cm
- Milimeters: mm