# intersect-great-circle

> calculate the intersection of two great circle arcs

Latest version **1.1.0** (published 2021-12-07) · bsd license · 0 weekly downloads

## Install

```sh
npm install intersect-great-circle
pnpm add intersect-great-circle
yarn add intersect-great-circle
bun add intersect-great-circle
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-12-07 |
| First published | 2021-12-05 |
| Weekly downloads | 0 |
| License | bsd |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 13.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | substack |

## Links

- npm: https://www.npmjs.com/package/intersect-great-circle
- npm.io page: https://npm.io/package/intersect-great-circle

## Dependencies (1)

- [gl-vec3](https://npm.io/package/gl-vec3.md) ^1.1.3

## Recent versions

- 1.1.0 (latest) — 2021-12-07
- 1.0.3 — 2021-12-07
- 1.0.2 — 2021-12-06
- 1.0.1 — 2021-12-06
- 1.0.0 — 2021-12-05

## README

# intersect-great-circle

calculate the intersection of two great circle arcs

if there is no intersection, return null

algorithm based on https://www.edwilliams.org/intersect.htm

# example

``` js
var intersect = require('intersect-great-circle')
var seattle = [-122.33,+47.61]
var chicago = [-87.65,+41.85]
var denver = [-104.98,+39.74]
var calgary = [-114.09,+51.05]

console.log(intersect([],seattle,chicago,denver,calgary))
```

output:

```
[ -110.25059713305886, 46.91934833795278 ]
```

# api

```
var intersect = require('great-circle-intersect')
```

## intersect(out, A, B, C, D, epsilon=1e-8)

Calculate the intersection of 2 arcs defined by the points `A`, `B`, `C`, and `D`,
storing the result in `out`.

The first arc is defined by points A and B. The second arc is defined by points C and D.

Each point is a 2-element array `[lon,lat]` in decimal degrees.

If there is no intersection, returns null. Otherwise returns `out`.

Optionally provide an `epsilon` to control tolerance for rounding errors to decide when there is an
intersection.

# install

npm install great-circle-intersect

# license

bsd

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