dragon expert
Chat with our AI personalities
yes it does nrg stands for energy
Here is the C code for DDA line drawing... #include<stdio.h> #include<conio.h> #include<graphics.h> #include<math.h> void main() { int gd, gm; float x, y, dx, dy, len; int x1, y1, x2, y2, i; detectgraph(&gd, &gm); initgraph(&gd, &gm,""); printf("\n Enter the coordinates of line : "); scanf("%d %d %d %d", &x1, &y1, &x2, &y2); dx = abs(x2-x1); dy = abs(y2-y1); if (dx >= dy) len = dx; else len = dy; dx = (x2-x1)/len; dy = (y2-y1)/len; x = x1 + 0.5; y = y1 + 0.5; i = 1; while (i <= len) { putpixel(x, y, 6); x = x+dx; y = y+dy; i++; } getch(); } -Suraj.
DDA Line Drawing AlgorithmStep 1:[Determine The Dx & Dy]Dx=Xb-XaDy=Yb-YaStep 2:[Determine Slope is Gentle or Sharp]If |Dx|>|Dy| thenGentle SlopeM=Dy/DxSet The Starting PointIf Dx>0 ThenC=CELING(Xb)D=Yb+M*(C-Xb)F=FLOOR(Xa)R=FLOOR(D+0.5)H=R-D+MIF M>0 ThenPositive Gentle SlopeM1=M-1Now Step Through The ColumnsWHILE Cabs(dy)) steps=abs(dx);else steps=abs(dy);xincrement=dx/(float)steps;yincrement=dy/(float)steps;putpixel(round(x),round(y),2)for(k=0;k
Can't Stand Greg
What GIS stand for in genetics