answersLogoWhite

0

C Programming Coding For DDA Algorithmvoid linedda(int xa,int ya,int xb,int yb) {

int dx=xb-xa,dy=yb-ya,steps,k;
float xincrement,yincrement,x=xa,y=ya;

if(abs(dx)>abs(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;kx+=xincrement;
y+=yincrement;
putpixel(round(x),round(y),2);
}
}
More Informationhttp://knol.Google.com/k/thiyagaraaj-m/dda-line-algorithm/1lfp8o9xxpx13/78#
http://i.thiyagaraaj.com/articles/articles/dda-line-algorithm
User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Advantages of DDA line drawing algorithm?

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


How can you implement Ricart and Agrawala's algorithm in c?

Ronaldo! 'c' coding of Ricart-agarwala algorithm


How do you write an Algorithm for a C plus plus Program?

You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.


What is algorithm in c?

Algorithm is a step by step process to solve a particular task.


What is an algorithm for multiplying rational numbers?

The algorithm is A/B * C/D = AB/CD.


C code to implement the file allocation algorithm?

yes we can do it,in c


Can you give a C program about SJF algorithm?

no.


Program in c to develop an algorithm that prints the n value of algorithm?

reymond rillera reymond rillera


What is the efficiency of the C scan algorithm for disk scheduling?

The efficiency of the C-scan algorithm for disk scheduling is considered to be high. It is a variant of the scan algorithm that improves performance by reducing the seek time of the disk arm. The C-scan algorithm scans the disk in one direction only, which can lead to faster access times compared to other algorithms.


C coding for cooley tukey fft algorithm?

hi.... for DIT fft algorithm, refer to this link, it has c-code for that. http://cnx.org/content/m12016/latest/


How do you write algorith of C programs?

There is no specific Hard and Fast rule for writing algorithm. The normal method is the following: 1. get a problem 2. find or invent an algorithm to solve it 3. implement the algorithm in a programming language (C, for example)


Algorithm of push and pop in c plus plus?

pop push c++ programming