Amazon Affiliate

Tuesday 25 June 2013

Parametric Line Drawing Algorithm.

Derivation and Algorithm of Parametric Line Drawing Algorithm.


DERIVATION :
                          It is the combination of points. Let us assume that we have plot a point of a line.
X  - Xa/ cos(angle) = Y – Ya / sin(angle) = r
X = Xa + r cos(angle)
Y = Ya + r sin(angle)

ALGORITHM OF PARAMETRIC LINE DRAWING :

Begin :
            Read (Xa ,Ya) and (Xb,Yb)
            X = Xa , Y= Ya
            while(X != Xb)
            {
                 plotpoint (X , Y)
                 X = Xa + r cos(angle) 
           Y = Ya + r sin(angle)
            }
             plotpoint (Xb ,Yb)
End 


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

No comments:

Post a Comment