/* Just the beginning of a new matrix * * compile with gcc -lm -o matrix matrix.c * run with ./matrix * * */ #include #include #include #define COLS 10 #define ROWS 20 int matrix[ROWS][COLS]; // funktion um die matrix komplett mit 0en auszufüllen void initMatrix() { int x,y; for (x=0; x x0) ? 1 : -1; while (x0 != x1) { x0 += dx; y0 = roundf(m*x0 + b); setPixel(x0, y0, value); } } } int main(int argc, char *argv[]) { initMatrix(); printMatrix(); drawLine (1,1,5,5,1); printMatrix(); }