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
js-convex-hull-2d
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.
Install
jspm
duo
No install step needed for duo!
component
bower
ender
jam
spm
npm
Require
jspm
let convexhull2d = require( "github:aureooms/js-convex-hull-2d" ) ; // or import convexhull2d from 'aureooms-js-convex-hull-2d' ;
duo
let convexhull2d = require( "aureooms/js-convex-hull-2d" ) ;
component, ender, spm, npm
let convexhull2d = require( "aureooms-js-convex-hull-2d" ) ;
bower
The script tag exposes the global variable
convexhull2d
.<script src="bower_components/aureooms-js-convex-hull-2d/js/dist/convex-hull-2d.min.js"></script>
Alternatively, you can use any tool mentioned here.
jam
require( [ "aureooms-js-convex-hull-2d" ] , function ( convexhull2d ) { ... } ) ;
Space
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
Reference