Yields every integer point along line.
line
Line
const l = { a: {x: 0, y: 0}, b: {x: 100, y: 100} };for (const p of Lines.pointsOf(l)) { // Do something with point `p`...} Copy
const l = { a: {x: 0, y: 0}, b: {x: 100, y: 100} };for (const p of Lines.pointsOf(l)) { // Do something with point `p`...}
Some precision is lost as start and end point is also returned as an integer.
Uses Bresenham's line algorithm
Yields every integer point along
line
.