Bresenham line algorithm
Syntax
Input
(x1,y1) | start position |
(x2,y2) | end position |
Output
x, y | the integer line coordinates from (x1,y1) to (x2,y2) |
Example
[x,y] = bresenham(1,1, 10,-5); plot(x,y,'or'); axis equal
Bresenham line algorithm
(x1,y1) | start position |
(x2,y2) | end position |
x, y | the integer line coordinates from (x1,y1) to (x2,y2) |
[x,y] = bresenham(1,1, 10,-5); plot(x,y,'or'); axis equal