Bresenham's line algorithm
bresenham-line algorithm for node and Browserify.
Warning
You need to have support for ES6 generators
Installation
You can install bresenham-line using npm.
npm install --save bresenham-line
Usage
Just require the module.
// es5var line = ; var genLine = ;consoledirgenLinenextvalue; // { x: 1, y: 1 }consoledirgenLinenextvalue; // { x: 2, y: 1 }consoledirgenLinenextvalue; // { x: 3, y: 1 }// ..
// es6; const startPoint = x: 1 y: 1; const finalPoint = x: 6 y: 2; for const point of consoledirpoint; // { x: 1, y: 1 }, { x: 2, y: 1 }, ...
License
MIT @ Nicolas Quiceno