0% found this document useful (0 votes)
28 views1 page

DDA Line Drawing Algorithm Steps

The DDA algorithm is an 11 step process for drawing a line between two points. It starts by declaring integer variables for the x and y coordinates of the start and end points and calculating the change in x and y. It then determines whether to increment by the x or y change each step. The algorithm sets the initial pixel, increments x and y by the calculated amounts, sets the new pixel, and repeats until the end point is reached.

Uploaded by

Zahid Abbas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views1 page

DDA Line Drawing Algorithm Steps

The DDA algorithm is an 11 step process for drawing a line between two points. It starts by declaring integer variables for the x and y coordinates of the start and end points and calculating the change in x and y. It then determines whether to increment by the x or y change each step. The algorithm sets the initial pixel, increments x and y by the calculated amounts, sets the new pixel, and repeats until the end point is reached.

Uploaded by

Zahid Abbas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

DDA Algorithm:

Step1: Start Algorithm

Step2: Declare x1,y1,x2,y2,dx,dy,x,y as integer variables.

Step3: Enter value of x1,y1,x2,y2.

Step4: Calculate dx = x2-x1

Step5: Calculate dy = y2-y1

Step6: If ABS (dx) > ABS (dy)


            Then step = abs (dx)
            Else

Step7: xinc=dx/step
            yinc=dy/step
            assign x = x1
            assign y = y1

Step8: Set pixel (x, y)

Step9: x = x + xinc
            y = y + yinc
            Set pixels (Round (x), Round (y))

Step10: Repeat step 9 until x = x2

Step11: End Algorithm

You might also like