Abstract
Bresenham's algorithm is well known as an efficient and elegant control program for drawing a best fit approximation to straight lines of arbitrary gradient with incremental plotters. More recently attention has been given to run line coding,' in which a line of gradient 1/3, for example, is generated through the sequence square move (x-step), diagonal move (step x and y together), square move, repeated as many times as necessary without repeating the tests and additions every time as implied by the basic algorithm. The purpose of this note is to draw attention to an automatic short cut which can be used with Bresenham's algorithm as shown in Fig. 1. The short cut instructions do not effect the output string, but they operate as Euclid's algorithm to give a short cut through a continued fraction expansion of the gradient of the intended line. The initial conditions for the algorithm of Fig. 1 are set up as for Bresenham's algorithm itself. If, for example, we wish to draw a straight line from some origin (0,0) to the point (w, v) in the 'first octant', i.e. 0 < v < u, with a conventional incremental plotter, we start with b = 2v,
Published Version (Free)
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have