Abstract
Drawing lines and curves on pixel graphic devices needs special attention in computer graphics. Algorithmic aspects of drawing lines and curves, especially the midpoint or Bresenham algorithm, are highlighted in this Chapter as well techniques for antialiasing to avoid staircasing effects. Examples in Java 2D are provided for the use of the techniques.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
To be precise: One addition and one subtraction.
- 2.
Note that (x 0,y 0) and (x 1,y 1) are assumed to be pixels, so that x 0, x 1, y 0 and y 1 must be integer values.
- 3.
H dx−dy D dy means (dx−dy) letters H followed by dy letters D.
References
Bresenham, J.E.: Algorithm for computer control of a digital plotter. IBM Syst. J. 4, 25–30 (1965)
Bresenham, J.E.: A linear algorithm for incremental digital display of circular arcs. Commun. ACM 20, 100–106 (1977)
Brons, R.: Linguistic methods for the description of a straight line on a grid. Comput. Graph. Image Process. 3, 48–62 (1974)
Brons, R.: Theoretical and linguistic methods for describing straight lines. In: [6], pp. 19–57
Cyrus, M., Beck, J.: Generalized two- and three-dimensional clipping. Computers and Graphics 3, 23–28 (1978)
Earnshaw, R.A. (ed.): Fundamental Algorithms for Computer Graphics. Springer, Berlin (1985)
Foley, J.D., van Dam, A., Feiner, S.K., Hughes, J.F.: Computer Graphics: Principles and Practice in C, 2nd edn. Addison-Wesley, Boston (1996)
Gupta, S., Sproull, R.E.: Filtering edges for gray-scale displays. Comput. Graph. 15, 1–5 (1981)
Hearn, D., Baker, M.P.: Computer Graphics with OpenGL, 3rd edn. Pearson Prentice Hall, Upper Saddle River, NJ (2004)
Kappel, M.R.: An ellipse-drawing algorithm for raster displays. In: [6], pp. 257–280
Pitteway, M.L.V.: Algorithms for drawing ellipses or hyperbolae with a digital plotter. Comput. J. 10, 282–289 (1967)
Pitteway, M.L.V., Watkinson, D.J.: Bresenham’s algorithm with gray scale. Commun. ACM 23, 625–626 (1980)
Van Aken, J.R.: An efficient ellipse-drawing algorithm. IEEE Comput. Graph. Appl. 4, 24–35 (1984)
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag London Limited
About this chapter
Cite this chapter
Klawonn, F. (2012). Drawing Lines and Curves. In: Introduction to Computer Graphics. Undergraduate Topics in Computer Science. Springer, London. https://doi.org/10.1007/978-1-4471-2733-8_3
Download citation
DOI: https://doi.org/10.1007/978-1-4471-2733-8_3
Publisher Name: Springer, London
Print ISBN: 978-1-4471-2732-1
Online ISBN: 978-1-4471-2733-8
eBook Packages: Computer ScienceComputer Science (R0)