convexhull

1.0.7 • Public • Published

convexhull

npm version Build Status

convex hull 2D algorithm using monotone chain algorithm

usage

const convexhull = require('convexhull')(/*options*/{x: 'lng', y: 'lat'});
 
const points = [
  {
    lng: 121.409058,
    lat: 31.191149
  },
  ...
];
 
let hull = convexhull(points);
 
// for unsorted points
hull = convexhull(points, true);
 

Options

option desc default
x property key x 'longitude'
y property key y 'latitude'

Reference

MonotoneChain

Readme

Keywords

Package Sidebar

Install

npm i convexhull

Weekly Downloads

1

Version

1.0.7

License

MIT

Last publish

Collaborators

  • eatgrass