Question

Can you make detailed solution ?

Given the DoA line drawing algorithm ist all of the points on the line (11) to (5,3). Give values i Deltax = ? Deltay = 1 X-i

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution - DDA line drawing algorithm :

  • Consider one point of the line as (X0,Y0) and the second point of the line as (X1,Y1).
  • We calculate dx , dy.
  • Depending on absolute value of dx and dy choose number of steps to put pixel as if (abs(dx) > abs(dy)) then steps = abs(dy) else steps = abs(dx).
  • Then calculate increment in x and y at each step as Xincr = dx/steps. Similary, Yincr = dy/steps.
  • Put pixel for each step as X = X0, Y = Y0 and repeat the steps.

So, we have (X0,Y0) = (1,1) to (X1,Y1) = (5,3)

deltaX = dx = X1 - X0 = 5-1 = 4

deltaY = dy = Y1 - Y0 = 3-1 = 2

Steps = (dx > dy) = dx = 4

Xincrement = dx / steps = 1

Yincrement = dy / steps = 0.5

Now we will iterate it for steps = 4 times

k Xk+1 Yk+1 Pixel_x Pixel_y
0 2 1.5 2 1
1 3 2 3 2
2 4 2.5 4 2
3 5 3 5 3
 
Add a comment
Know the answer?
Add Answer to:
Can you make detailed solution ? Given the DoA line drawing algorithm ist all of the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT