haversine-offset

    1.0.0 • Public • Published

    haversine-offset

    build status Version

    js-standard-style

    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 },

    License MIT

    Install

    npm i haversine-offset

    DownloadsWeekly Downloads

    45

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • dcousens