1.DDA算法 DDA(Digital Differential Analyer):数字微分法 DDA算法思想:增量思想 公式推导: 效率:采用了浮点加法和浮点显示是需要取整 代码: void lineDDA(int x0, int y0, int x1, int y1, int color){ int x; float dy, dx, y, m; dx = x1 - x0; dy = y1 - y0; m = dy / dx; y = y0; for (x = x0; x <= x1; x++
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using System.Drawing; using System.Drawing.Drawing2D; namespace Bresenham { public parti
// DDA.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include<Windows.h> #include<graphics.h> #include<conio.h> #include<math.h> void dda_line(int xa, int ya, int xb, int yb, int c); int main(int argc, _TCHAR* argv[]) { int