z-logo
open-access-imgOpen Access
Bresenham's Algorithm with Run Line Coding Shortcut
Author(s) -
M. L. V. Pitteway,
A. J. R. Green
Publication year - 1982
Publication title -
the computer journal
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.319
H-Index - 64
eISSN - 1460-2067
pISSN - 0010-4620
DOI - 10.1093/comjnl/25.1.114
Subject(s) - plotter , algorithm , computer science , diagonal , line (geometry) , coding (social sciences) , point (geometry) , sequence (biology) , set (abstract data type) , mathematics , computer graphics (images) , geometry , statistics , biology , genetics , programming language
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,

The content you want is available to Zendy users.

Already have an account? Click here to sign in.
Having issues? You can contact us here
Accelerating Research

Address

John Eccles House
Robert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom