npm.io
1.0.7 • Published 9 years ago

convexhull

Licence
MIT
Version
1.0.7
Deps
1
Vulns
0
Weekly
0

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

Keywords