coordinatesOnLine(stepRate, results) → {array}
Using Bresenham's line algorithm this will return an array of all coordinates on this line.
The start and end points are rounded before this runs as the algorithm works on integers.
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
stepRate | number | <optional> | 1 | How many steps will we return? 1 = every coordinate on the line, 2 = every other coordinate, etc. |
results | array | <optional> | The array to store the results in. If not provided a new one will be generated. |
Returns
array -
An array of coordinates.
- Source code: geom/Line.js (Line 278)
Please login to continue.