Computer Science, asked by chiragkaushal1, 8 days ago

Describe DDA line drawing algorithm. Implement the DDA algorithm to draw a line from(0,0) to (6,8).

Answers

Answered by s1055deeksha05200
0

this is your answer

okokokok

Attachments:
Answered by yassersayeed
0

Solution: Let us first calculate the slope of the given line

m = (6-0)/(8-0) = 1

Since the slope of the line is 1, we will sample the points at unit x intervals i.e. dx=1

then the next point on y axis corresponding to the previous point plotted will be

y(k+1) = y(k) + m

The table below shows the points to be plotted

(x,y)

(0,0)

(2,4)  

(6,8)

P.S DDA algorithm is really good for lines with linear slope

Similar questions