Skip to content

eatgrass/convexhull

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'

Sample

Reference

MonotoneChain

About

convex hull 2D algorithm using monotone chain algorithm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published