bresenham's algorithm line drawing
how bresenham's algorithm for line drawing working?

See All Responses Below...
Message Rating
Posted on: 20/05/2012
Bresenham's algorithm works with the use of a decision parameter. In the case of positive slope, X value will increase at unit interval of time. And if decision parameter is less than zero then Y value will take previous Y value, otherwise Y value is Y+1.

If P is the decision parameter then initial decision parameter Po is calculated by 2dy-dx, where dx = x2-x1 and  dy=y2- y1,
where the end points of required line is (x1,y1) and (x2,y2).

If P<0 then next P+1 value is calculated by P +2dy

If p>=0 then next P+1 value is calculated by P+2dy-2dx
Please Login to Post Your Comments
Name (Max. 100 characters)
Please post your comments here
Select Language
Attach File(Max. Size: 2 MB)
A few simple rules when posting your Comments,
  1. Please post only answers relevant to the topic of discussion.
  2. Please dont misuse this site or do not be abusive, offensive, inappropriate,harass anyone on the boards or post ads or spam. Doing so will delete your inappropriate messages and will block or delete your account on this site. 

Related Threads

Academic Projects