View source: R/helper_functions.r
bresenham | R Documentation |
This function generates a list of points that form a line between two given points using Bresenham's line algorithm.
bresenham(x0, y0, x1, y1)
x0 |
The x-coordinate of the starting point. |
y0 |
The y-coordinate of the starting point. |
x1 |
The x-coordinate of the ending point. |
y1 |
The y-coordinate of the ending point. |
A list of points that form a line between the two given points.
bresenham(0, 0, 5, 5)
bresenham(0, 0, -5, -5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.