Redirected
recategorized
2,698 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)]$
recategorized

3 Answers

3 votes
3 votes

Option =A is the right ansdda solution

1 votes
1 votes

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.

Answer:

Related questions

0 votes
0 votes
3 answers
2
2 votes
2 votes
1 answer
3
makhdoom ghaya asked Jul 25, 2016
3,201 views
Match the following $:$$\begin{array}{clcl} & \textbf{List – I} && \textbf{List – II} \\ \text{a.} & \text{Cavalier} & \text{i.} & \text{The direction of projection...