in Computer Graphics recategorized
1,049 views
0 votes
0 votes

Consider a line $AB$ with $A=(0,0)$ and $B=(8,4)$. Apply a simple $DDA$ algorithm and compute the first four plots on this line.

  1. $[(0,0),(1,1),(2,1),(3,2)]$
  2. $[(0,0),(1,1.5),(2,2),(3,3)]$
  3. $[(0,0),(1,1),(2,2.5),(3,3)]$
  4. $[(0,0),(1,2),(2,2),(3,2)]$
in Computer Graphics recategorized
1.0k views

3 Answers

3 votes
3 votes

Option =A is the right ansdda solution

1 comment

Key point which I mistaken is don't take rounded off value for next iteration. Take original value of y for next iteration, otherwise u ll be in trouble.
0
0
1 vote
1 vote

According to DDA algorithm,

|dx| = 8, |dy| = 4

since |dx| > |dy|, steps = |dx| = 8

Xinc = |dx|/steps = 1, Yinc  = |dy|/steps = 0.5.

Algorithm:

for k = 1 to steps:

     Xk+1 = Y+ Xinc

    Yk+1 = Yk + Yinc

    // plot round(Xk+1), round(Yk+1)

Since DDA works with integer values only, we need to round the values of coordinates to nearest integer. Consider 0.5 to be rounded to 1.

Thus following the algorithm, we get the first four points as (0, 0), (1, 1), (2, 1), (3, 2).

Hence option 1.

1 comment

Not the proper algorithm ,question has asked for simple dda while you applied incremental DDA
0
0
0 votes
0 votes
(1).

y= mx.c

dy= 4

dx= 8

m= dy/dx= 4/8 = 0.5

m< 1

x inc= 1, y inc = 0.5
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true