void LineTest( int32_t x0, int32_t y0, int32_t x1, int32_t y1 ) { /* https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm plotLine(int x0, int y0, int x1, int y1) dx = abs(x1-x0); sx = x0= dy) err += dy; // e_xy+e_x > 0 x0 += sx; end if if (e2 <= dx) // e_xy+e_y < 0 err += dx; y0 += sy; end if end while */ int32_t dx = abs(x1-x0); int32_t sx = x0= dy ) { err += dy; x0 += sx; } if (e2 <= dx) { err += dx; y0 += sy; } } }