JSPM

gps-manager

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q14719F
  • License ISC

Manage GPS coordinates points

Package Exports

  • gps-manager

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gps-manager) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

GPS-Manager [WIP]

Node.js module to manage gps coordinates points

Installation

npm install gps-manager

Usage

###.toRad(val) Convert degrees to radians

  • val: Degree value

###.toDeg(val) Convert radians to degrees

  • val: Radian value

###.getMiddle(lat1,lng1,lat2,lng2) Get midpoint of two gps coordinates points

  • lat1: Point 1 latitude
  • lng1: Point 1 longitude
  • lat2: Point 2 latitude
  • lng2: Point 2 longitude

###.getDistance(lat1,lng1,lat2,lng2) Get distance between two gps coordinates points

  • lat1: Point 1 latitude
  • lng1: Point 1 longitude
  • lat2: Point 2 latitude
  • lng2: Point 2 longitude

Example

var gps = require('gps-manager');

//-- Convert to radians
var toRad = gps.toRad(48.2320728);

//-- Convert to degrees
var toDeg = gps.toDeg(0.8418084754216004);

//-- Mid point of two coordinates points
var midPoint = gps.getMiddle(48.2320728, 4.1482735, 48.2320524, 4.1480716);

//-- Distance between two coordinates points
var distance = gps.getDistance(48.2320728, 4.1482735, 48.2320524, 4.1480716);