0.0.20 • Published 10 months ago

@jrc03c/js-convex-hull v0.0.20

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

Introduction

js-convex-hull gets the convex hull of a set of 2D points using the "gift-wrapping" (AKA "Jarvis march") algorithm.

npm.io

Installation

npm install --save @jrc03c/js-convex-hull

Usage

Add the script to your page:

<script src="path/to/js-convex-hull.js"></script>

Or require it for use with bundlers:

const { getConvexHull } = require("@jrc03c/js-convex-hull")

Then call the getConvexHull function (which returns the subset of points that represents the hull), passing in an array of 2D points:

let points = [
  [0, 5],
  [7, 2],
  [-3, 8],
  [4, -5],
  ...
]

let hull = getConvexHull(points)

Check out the demo to see it in action!

0.0.20

10 months ago

0.0.14

10 months ago

0.0.15

10 months ago

0.0.16

10 months ago

0.0.17

10 months ago

0.0.18

10 months ago

0.0.19

10 months ago

0.0.13

11 months ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.5

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

3 years ago