A collection of terse geometry utilities.
-
Memory managed each utility has a pool of instances accessable using
_X_.make()
and_X_.free()
. If you don't need pooled instances, simply pass in your own object instead. -
State less no state is kept within the utilities, it's up to you.
var geom = require('geom')
, vec = geom.vec;
var v = vec.make(10,10);
vec.smul(v,10) // => [100,100]
Here are some resources which was helpful while compiling this collection:
- https://github.com/tmpvar/vec2.js
- https://github.com/jnordberg/geometry.js
- https://github.com/okcupid/node-geom2d/
- https://github.com/STRd6/matrix.js
- http://paulbourke.net/geometry
- http://www.codeproject.com/Articles/15573/2D-Polygon-Collision-Detection
- http://softsurfer.com/algorithm_archive.htm
- https://github.com/polygonal/core
- https://en.wikipedia.org/wiki/Machine_epsilon