# spherical

> spherical operations on the globe

Latest version **0.2.0** (published 2016-03-22) · BSD-2-Clause license · 1.6K weekly downloads

## Install

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

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2016-03-22 |
| First published | 2013-12-11 |
| Weekly downloads | 1.6K |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Tom MacWright |
| Maintainers | tmcw |
| Keywords | spherical, geodesy, operations |

## Links

- npm: https://www.npmjs.com/package/spherical
- Repository: https://github.com/mapbox/spherical
- Issues: https://github.com/mapbox/spherical/issues
- npm.io page: https://npm.io/package/spherical

## Dependencies (1)

- [wgs84](https://npm.io/package/wgs84.md) 0.0.0

## Recent versions

- 0.2.0 (latest) — 2016-03-22
- 0.1.0 — 2014-07-25
- 0.0.1 — 2014-02-22
- 0.0.0 — 2013-12-11

## README

[![Build Status](https://travis-ci.org/mapbox/spherical.png)](https://travis-ci.org/mapbox/spherical)

# spherical

Spherical world utilities

## api

The default value of the radius is Earth's radius of 6378137 meters.

`heading(from, to)`

Heading expressed as degrees between locations expressed as `[lon, lat]`.

`distance(from, to, [radius])`

Distance in meters between locations expressed as `[lon, lat]`.

`radial(from, heading, distance, [radius])`

Given a location as `[lon, lat]`, heading in degrees, and distance in meters,
return another `[lon, lat]` point of a point at that offset.

## credits

Adapted from OpenLayers

* [Aviation Formulary](http://williams.best.vwh.net/avform.htm)

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