point-distance
Get the distance between 2 points on a 2d, 3d or Earth-like plane.
Install
npm install point-distance
Usage
const pointDistance = console//=> 5 console//=> 13 console//=> 117.6259
API
pointDistance([startX, startY, startZ?], [endX, endY, endZ?])
Get the distance between 2 points on a 2d or 3d plane.
startX, startY, startZ, endX, endY, endZ
Type: number
The starting and ending coordinates to get the distance between.
pointDistance.earth([startLatitude, startLongitude, startAltitude?], [endLatitude, endLongitude, endAltitude?])
Get the distance between 2 coordinates on Earth. Returns the distance in metres.
startLatitude, startLongitude, endLatitude, endLongitude
Type: number
The starting and ending coordinates to get the distance between.
startAltitude, endAltitude
Type: number
The starting and ending altitudes between the 2 coordinates in metres.