
related topics 
{math, number, function} 
{system, computer, user} 
{line, north, south} 
{math, energy, light} 
{@card@, make, design} 
{work, book, publish} 
{day, year, event} 
{government, party, election} 

The Bresenham line algorithm is an algorithm which determines which points in an ndimensional raster should be plotted in order to form a close approximation to a straight line between two given points. It is commonly used to draw lines on a computer screen, as it uses only integer addition, subtraction and bit shifting, all of which are very cheap operations in standard computer architectures. It is one of the earliest algorithms developed in the field of computer graphics. A minor extension to the original algorithm also deals with drawing circles.
While algorithms such as Wu's algorithm are also frequently used in modern computer graphics because they can support antialiasing, the speed and simplicity of Bresenham's line algorithm mean that it is still important. The algorithm is used in hardware such as plotters and in the graphics chips of modern graphics cards. It can also be found in many software graphics libraries. Because the algorithm is very simple, it is often implemented in either the firmware or the hardware of modern graphics cards.
The label "Bresenham" is used today for a whole family of algorithms extending or modifying Bresenham's original algorithm. See further references below.
Contents
The algorithm
The common conventions that pixel coordinates increase in the down and right directions (e.g. that the pixel at (1,1) is directly above the pixel at (1,2)) and that the pixel centers that have integer coordinates will be used. The endpoints of the line are the pixels at (x_{0}, y_{0}) and (x_{1}, y_{1}), where the first coordinate of the pair is the column and the second is the row.
The algorithm will be initially presented only for the octant in which the segment goes down and to the right (x_{0}≤x_{1} and y_{0}≤y_{1}), and its horizontal projection x_{1} − x_{0} is longer than the vertical projection y_{1} − y_{0} (the line has a slope whose absolute value is less than 1 and greater than 0.) In this octant, for each column x between x_{0} and x_{1}, there is exactly one row y (computed by the algorithm) containing a pixel of the line, while each row between y_{0} and y_{1} may contain multiple rasterized pixels.
Full article ▸


related documents 
NaN 
INTERCAL 
Generalized Riemann hypothesis 
Diffeomorphism 
Monotonic function 
Algebraic topology 
Isomorphism theorem 
Conjunctive normal form 
Axiom of regularity 
Tree (data structure) 
Differential topology 
Discriminant 
Pseudorandomness 
Knight's tour 
Cartesian product 
Theory of computation 
Laurent series 
Mean value theorem 
Kolmogorov space 
Automated theorem proving 
Diophantine set 
Spectrum of a ring 
Wellorder 
Controllability 
Product topology 
Lebesgue measure 
Goodstein's theorem 
Carmichael number 
De Morgan's laws 
Group representation 
