Convex hull algorithms in two dimensions. Parent is aureooms/js-cg.
// * - < - * - < - *
// / \
// hi[0] = lo[0] * * hi[p + 1] = lo[q + 1]
// \ /
// * - > - * - > - *
Can be managed through jspm, duo, component, bower, ender, jam, spm, and npm.
jspm install github:aureooms/js-convex-hull-2d
# or
jspm install npm:@aureooms/js-convex-hull-2d
No install step needed for duo!
component install aureooms/js-convex-hull-2d
bower install @aureooms/js-convex-hull-2d
ender add @aureooms/js-convex-hull-2d
jam install @aureooms/js-convex-hull-2d
spm install @aureooms/js-convex-hull-2d --save
npm install @aureooms/js-convex-hull-2d --save
let convexhull2d = require( "github:aureooms/js-convex-hull-2d" ) ;
// or
import convexhull2d from '@aureooms/js-convex-hull-2d' ;
let convexhull2d = require( "aureooms/js-convex-hull-2d" ) ;
let convexhull2d = require( "@aureooms/js-convex-hull-2d" ) ;
The script tag exposes the global variable convexhull2d
.
<script src="https://github.com/make-github-pseudonymous-again/js-convex-hull-2d/raw/master/bower_components/@aureooms/js-convex-hull-2d/js/dist/convex-hull-2d.min.js"></script>
Alternatively, you can use any tool mentioned here.
require( [ "@aureooms/js-convex-hull-2d" ] , function ( convexhull2d ) { ... } ) ;
The 2^d space system object must have the following static methods:
space.crs( a , b , c ) ; // compute the cross product of ab and bc
space.dot( a , b , c ) ; // compute the dot product of ab and bc
space.col( a , b , c ) ; // test whether 3 points are colinear
space.pit( x , a , b , c ) ; // test whether x is in triangle abc
space.lex( a , b ) ; // > 0 if a comes before b in lex order
space.colex( a , b ) ; // > 0 if a comes before b in colex order
space.ccw( crs , dot , x ) ; // defines a counter clockwise ordering around x