31 lines
500 B
C++
31 lines
500 B
C++
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <stdint.h>
|
||
|
|
#include <stdlib.h>
|
||
|
|
|
||
|
|
namespace UwU {
|
||
|
|
|
||
|
|
class Bresenham {
|
||
|
|
private:
|
||
|
|
int16_t x0;
|
||
|
|
int16_t y0;
|
||
|
|
int16_t x1;
|
||
|
|
int16_t y1;
|
||
|
|
int16_t d;
|
||
|
|
int16_t
|
||
|
|
|
||
|
|
public:
|
||
|
|
Bresenham(int16_t x0, int16_t y0, int16_t x1, int16_t y1) {
|
||
|
|
this->x0 = x0;
|
||
|
|
this->y0 = y0;
|
||
|
|
this->x1 = x1;
|
||
|
|
this->y1 = y1;
|
||
|
|
|
||
|
|
if (abs(y1 - y0) < abs(x1 - x0)) {
|
||
|
|
if (x0 > x1) {
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
};
|
||
|
|
}
|