# convex-hull

> Any dimensional convex hull

Latest version **1.0.3** (published 2014-11-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install convex-hull
pnpm add convex-hull
yarn add convex-hull
bun add convex-hull
```

## 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.0.3 |
| Published | 2014-11-22 |
| First published | 2014-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 38 |
| Author | Mikola Lysenko |
| Maintainers | mikolalysenko |
| Keywords | convex, hull, any, dimension |

## Links

- npm: https://www.npmjs.com/package/convex-hull
- Repository: https://github.com/mikolalysenko/convex-hull
- Issues: https://github.com/mikolalysenko/convex-hull/issues
- npm.io page: https://npm.io/package/convex-hull

## Dependencies (3)

- [affine-hull](https://npm.io/package/affine-hull.md) ^1.0.0
- [incremental-convex-hull](https://npm.io/package/incremental-convex-hull.md) ^1.0.1
- [monotone-convex-hull-2d](https://npm.io/package/monotone-convex-hull-2d.md) ^1.0.1

## Recent versions

- 1.0.3 (latest) — 2014-11-22
- 1.0.2 — 2014-11-22
- 1.0.1 — 2014-11-22
- 1.0.0 — 2014-11-22

## README

convex-hull
===========
This module is a wrapper over various convex hull modules which exposes a simple interface for computing convex hulls of point sets in any dimension.

# Example

```javascript
var ch = require('convex-hull')

var points = [
  [0,0],
  [1,0],
  [0,1],
  [0.15,0.15],
  [0.5, 0.5]
]


//Picture:
//
// [0,1] *
//       |\
//       | \
//       |  \
//       |   \
//       |    \
//       |     \
//       |      \
//       |       * [0.5,0.5]
//       |        \
//       |         \
//       |          \
//       |           \
//       |            \
//       |    *        \
//       | [0.15,0.15]  \
// [0,0] *---------------* [1,0]
//

console.log(ch(points))
```

Output:

```javascript
[[0, 1], [1, 2], [2, 0]]
```

# Install

```
npm install convex-hull
```

If you want to use it in a webpage, use [browserify](http://browserify.org).

# API

#### `require('convex-hull')(points)`
Computes the convex hull of `points`

* `points` is an array of points encoded as `d` length arrays

**Returns** A polytope encoding the convex hull of the point set.

**Time complexity** The procedure takes O(n^floor(d/2) + n log(n)) time.

**Note** This module is a wrapper over incremental-convex-hull and monotone-convex-hull for convenience.  It will select an optimal algorithm for whichever dimension is appropriate.


# Credits
(c) 2014 Mikola Lysenko. MIT License

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