64. int x, x1, x2, y1, y2, cor;
float y, m;
//coeficiente angular
m = (y2 – y1)/(x2 – x1);
//iteração
for (x = x1; x <= x2; x++) {
//coeficiente linear
y = y1 + m * (x – x2);
//arredonda y e imprime na tela
write_pixel(x, round(y),
cor);
}
Variando-se x
unitariamente, de
pixel em pixel,
encontramos o
valor de y