geographiclib-geodesic
JavaScript implementation of geodesic routines in GeographicLib
Last updated a year ago by cffk .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install geographiclib-geodesic 
SYNC missed versions from official npm registry.

JavaScript implementation of the geodesic routines in GeographicLib

This package is a JavaScript implementation of the geodesic routines from GeographicLib. This solves the direct and inverse geodesic problems for an ellipsoid of revolution.

Prior to version 2.0.0, this was a component of the node package geographiclib. As of version 2.0.0, that package was split into the packages geographiclib-geodesic (this package) and geographiclib-dms. geographiclib will be deprecated on 2023-05-01.

Licensed under the MIT/X11 License; see LICENSE.txt.

Installation

$ npm install geographiclib-geodesic

Usage

In node, do

var geodesic = require("geographiclib-geodesic");

Documentation

Full documentation is provided at https://geographiclib.sourceforge.io/JavaScript/doc.

Examples

var geodesic = require("geographiclib-geodesic"),
    geod = geodesic.Geodesic.WGS84, r;

// Find the distance from Wellington, NZ (41.32S, 174.81E) to
// Salamanca, Spain (40.96N, 5.50W)...
r = geod.Inverse(-41.32, 174.81, 40.96, -5.50);
console.log("The distance is " + r.s12.toFixed(3) + " m.");
// This prints "The distance is 19959679.267 m."

// Find the point 20000 km SW of Perth, Australia (32.06S, 115.74E)...
r = geod.Direct(-32.06, 115.74, 225, 20000e3);
console.log("The position is (" +
            r.lat2.toFixed(8) + ", " + r.lon2.toFixed(8) + ").");
// This prints "The position is (32.11195529, -63.95925278)."

Authors

Current Tags

  • 2.2.0                                ...           latest (a year ago)

7 Versions

  • 2.2.0                                ...           a year ago
  • 2.1.1                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.0                                ...           5 years ago
  • 2.0.0-beta3                                ...           5 years ago
  • 2.0.0-beta2 [deprecated]           ...           5 years ago
  • 2.0.0-beta1 [deprecated]           ...           5 years ago
Maintainers (1)
Downloads
Total 11
Today 0
This Week 6
This Month 11
Last Day 4
Last Week 5
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE