# robust-in-sphere

> Exact arithmetic test to check if point is contained in sphere

Latest version **1.2.1** (published 2021-08-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install robust-in-sphere
pnpm add robust-in-sphere
yarn add robust-in-sphere
bun add robust-in-sphere
```

## 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.2.1 |
| Published | 2021-08-04 |
| First published | 2013-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 28.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Mikola Lysenko |
| Maintainers | mikolalysenko |
| Keywords | sphere, robust, geometric, predicate, exact, geometry |

## Links

- npm: https://www.npmjs.com/package/robust-in-sphere
- Repository: https://github.com/mikolalysenko/robust-in-sphere
- Homepage: https://github.com/mikolalysenko/robust-in-sphere#readme
- Issues: https://github.com/mikolalysenko/robust-in-sphere/issues
- npm.io page: https://npm.io/package/robust-in-sphere

## Dependencies (4)

- [robust-sum](https://npm.io/package/robust-sum.md) ^1.0.0
- [two-product](https://npm.io/package/two-product.md) ^1.0.0
- [robust-scale](https://npm.io/package/robust-scale.md) ^1.0.0
- [robust-subtract](https://npm.io/package/robust-subtract.md) ^1.0.0

## Recent versions

- 1.2.1 (latest) — 2021-08-04
- 1.1.3 — 2014-06-02
- 1.1.2 — 2014-06-02
- 1.1.1 — 2014-05-07
- 1.1.0 — 2014-05-07
- 1.0.2 — 2014-04-28
- 1.0.1 — 2014-03-30
- 1.0.0 — 2014-03-30
- 0.0.1 — 2013-10-25
- 0.0.0 — 2013-10-22

## README

robust-in-sphere
================
Exact arithmetic test to check if (n+2) points are cospherical.

(Very) loosely inspired by [Jonathan Shewchuk's work on robust predicates](http://www.cs.cmu.edu/~quake/robust.html).  Currently not as fast, but pull requests are welcome.

[![testling badge](https://ci.testling.com/mikolalysenko/robust-in-sphere.png)](https://ci.testling.com/mikolalysenko/robust-in-sphere)

[![build status](https://secure.travis-ci.org/mikolalysenko/robust-in-sphere.png)](http://travis-ci.org/mikolalysenko/robust-in-sphere)

# Example

```javascript
var inSphere = require("robust-in-sphere")

console.log(inSphere(
  [0, 1],
  [1, 0],
  [-1, 0],
  [0, -1]))
```

# Install

```
npm install robust-in-sphere
```

# API

```javascript
var inSphere = require("robust-in-sphere")
```

### `inSphere(a,b,c,...)`
Tests if a collection of `n+2` points in `n`-dimensional space are cospherical or if the last point is contained in the sphere or not.

* `a,b,c,...` is a list of points

**Returns** A signed integer that gives the orientation of the points
* `<0` if the last point is contained in the oriented sphere defined by the previous two points
* `>0` if the last point is outside the sphere
* `0` is the points are cospherical

**Notes** Up to 6 points it is possible to get a specialized version of `inSphere` that avoids an extra dispatch using the syntax:

```javascript
inSphere[4](a,b,c,d) === inSphere(a,b,c,d)
```

## Credits
(c) 2014 Mikola Lysenko. MIT License

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