中点画线算法
2018-03-09 10:53:12 11 举报
中点画线算法
作者其他创作
大纲/内容
START
N
Y
END
mark=1?
x++;e = e + 2 * dy;
e 0?
y1y0?
temp = x1;x1 = y1;y1 = temp;
k==0?
y++; e = e - 2 * dx;
(y1 - y0) (x1 - x0) ?
x1=x0?
y1 = -y1;y0 = -y0;mark = 1;
temp = x1;x1 = x0;x0 = temp;\t
temp = y1;y1 = y0;y0 = temp;\t
temp = x0;x0 = y0;y0 = temp;k = 1;
x1x0?
dx = x1 - x0;dy = y1 - y0;e = -dx;x = x0;y = y0;
x=x1?
x1 = -x1;x0 = -x0;mark = 2;
mark=0?
mark=2?
0 条评论
下一页