# geographiclib

> JavaScript implementation of geodesic routines in GeographicLib

Latest version **1.52.2** (published 2022-04-29) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install geographiclib
pnpm add geographiclib
yarn add geographiclib
bun add geographiclib
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.52.2 |
| Published | 2022-04-29 |
| First published | 2013-05-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 314.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 52 |
| Author | Charles Karney |
| Maintainers | cffk |
| Keywords | geodesics, geometry, geographiclib, geography, geodesic problem, direct geodesic problem, inverse geodesic problem, geodesic calculator |

## Links

- npm: https://www.npmjs.com/package/geographiclib
- Repository: https://github.com/geographiclib/geographiclib-js
- Homepage: https://github.com/geographiclib/geographiclib-js#readme
- Issues: https://github.com/geographiclib/geographiclib-js/issues
- npm.io page: https://npm.io/package/geographiclib

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 1.52.2 (latest) — 2022-04-29
- 1.52.1 — 2022-04-29
- 1.52.0 — 2021-06-22
- 1.51.0 — 2020-12-01
- 1.50.0 — 2019-09-24
- 1.49.0 — 2017-10-05
- 1.48.0 — 2017-04-09
- 1.47.0 — 2017-02-15
- 1.46.0 — 2016-02-15
- 1.46.0-beta2 — 2016-02-14
- 1.46.0-beta1 — 2015-10-14
- 1.45.0 — 2015-09-30
- 1.45.0-beta7 — 2015-09-28
- 1.45.0-beta6 — 2015-09-24
- 1.45.0-beta5 — 2015-09-20
- … 9 more at https://npm.io/package/geographiclib/versions

## README

# Geodesic routines from GeographicLib

This library is a JavaScript implementation of the geodesic routines
from [GeographicLib](https://geographiclib.sourceforge.io).  This solves the
direct and inverse geodesic problems for an ellipsoid of revolution.

Licensed under the MIT/X11 License; see
[LICENSE.txt](https://geographiclib.sourceforge.io/LICENSE.txt).

**WARNING:** Since version 2.x, this package has been separated into the
[geographiclib-geodesic](https://www.npmjs.com/package/geographiclib-geodesic)
and
[geographiclib-dms](https://www.npmjs.com/package/geographiclib-dms)
packages.  [geographiclib](https://www.npmjs.com/package/geographiclib)
will be deprecated on 2023-05-01.

## Installation

```bash
$ npm install geographiclib
```

## Usage

In [node](https://nodejs.org), do
```javascript
var GeographicLib = require("geographiclib");
```

## Documentation

Full documentation is provided at
[https://geographiclib.sourceforge.io/JavaScript/1.52.2/index.html](https://geographiclib.sourceforge.io/JavaScript/1.52.2/).

## Examples

```javascript
var GeographicLib = require("geographiclib"),
    geod = GeographicLib.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

* algorithms + js code: Charles Karney (charles@karney.com)
* node.js port: Yurij Mikhalevich (yurij@mikhalevi.ch)

---
_Source: https://npm.io/package/geographiclib · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
