Amazon Affiliate

Tuesday 25 June 2013

Algorithm and Drawback of DDA Line Drawing Algorithm.

Algorithm and Drawback of DDA Line Drawing Algorithm.

ALGORITHM OF DDA LINE DRAWING :

Begin :
            Read (Xa ,Ya) and (Xb ,Yb)

            if (dY > dX)

                 steps = dY

            else

                  steps =dX

            Xinc = dX/steps

            Yinc = dY/steps

             X = Xa , Y=Ya

            for i=1 to steps

            plotpoint (X , Y)

            X = X + Xinc

            Y = Y + Yinc

End 

DRAWBACK  OF DDA LINE DRAWING :
  •     Round of error.
  •    Floating point operation.
  •    Stair case output.

No comments:

Post a Comment