convex-hull

WebJar for convex-hull

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

convex-hull
Last Version

Last Version

1.0.3
Release Date

Release Date

Type

Type

jar
Description

Description

convex-hull
WebJar for convex-hull
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mikolalysenko/convex-hull

Download convex-hull

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/convex-hull/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>convex-hull</artifactId>
    <version>1.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/convex-hull/
implementation 'org.webjars.npm:convex-hull:1.0.3'
// https://jarcasting.com/artifacts/org.webjars.npm/convex-hull/
implementation ("org.webjars.npm:convex-hull:1.0.3")
'org.webjars.npm:convex-hull:jar:1.0.3'
<dependency org="org.webjars.npm" name="convex-hull" rev="1.0.3">
  <artifact name="convex-hull" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='convex-hull', version='1.0.3')
)
libraryDependencies += "org.webjars.npm" % "convex-hull" % "1.0.3"
[org.webjars.npm/convex-hull "1.0.3"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : affine-hull jar [1.0.0,2)
org.webjars.npm : incremental-convex-hull jar [1.0.1,2)
org.webjars.npm : monotone-convex-hull-2d jar [1.0.1,2)

Project Modules

There are no modules declared in this project.

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

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:

[[0, 1], [1, 2], [2, 0]]

Install

npm install convex-hull

If you want to use it in a webpage, use browserify.

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

Versions

Version
1.0.3