Amazon Affiliate

Tuesday 25 June 2013

Pseudo Line Drawing Algorithm.

Derivation and Algorithm of Pseudo Line Drawing Algorithm


DERIVATION :

                  It is the combination of points. Let us assume that we have plot a point of a line.
Y - Y1 = Y2 –Y1/X2 –X1 (X – X1)
Y = Y1 + Y2 –Y1/X2 –X1 (X – X1)

ALGORITHM OF PSEUDO LINE DRAWING :
Begin :
            Read (Xa ,Ya) and (Xb,Yb)
            X = Xa , Y= Ya
            while(X != Xb)
            {
                 plotpoint (X , Y)
                 X =X +1
                 Y = Ya + Yb-Ya/Xb-Xa (X - Xa)
            }
             plotpoint (Xb ,Yb)
End 

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

No comments:

Post a Comment