正在加载图片...
The Basic Incremental Algorithm void Line(into, intyo, intx1, inty 1, value)i Int x Float dy, dx, y, m; dy=y1-y0: dxex1-XO m≡dydx; y=y0; for(X=X0; X<=X1; X++)i WritePixel(x, (int floor(y+0. 5), value +=m yThe Basic Incremental Algorithm void Line (intx0, inty0, intx1, inty1, value) { Int x; Float dy, dx, y, m; dy=y1-y0; dx=x1-x0; m=dy/dx; y=y0; for(x=x0; x<=x1; x++) { WritePixel(x, (int)floor(y+0.5), value); y+=m; } }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有