haversine-offset
v1.0.0
Published
Haversine offset formula in Javascript. Uses meters. Nothing more.
Downloads
177
Maintainers
Readme
haversine-offset
Haversine offset formula in Javascript. Uses meters. Nothing more.
Example
Offset is in meters, x
is along the longitudinal axis (East / West), y
along the latitudinal axis (North / South).
var haversineOffset = require('haversine-offset')
var a = { latitude: -37.8136, longitude: 144.9631 }
var offset = { x: 100, y: 150 }
console.log(haversineOffset(a, offset))
// { lat: -37.812252527073824, lng: 144.96423709426978 },
lat
, lng
variants will also work:
var haversineOffset = require('haversine-offset')
var a = { lat: -37.8136, lng: 144.9631 }
var offset = { x: 100, y: 150 }
console.log(haversineOffset(a, offset))
// { lat: -37.812252527073824, lng: 144.96423709426978 },