File Exchange

image thumbnail

Bresenham line generation

version (1.92 KB) by Chandan Kumar
Draws line using Bresenham line generation algorithm


Updated 09 Oct 2009

View License

This code uses Bresenham line generation algorithm to generate a line, with modified expression for error calculation which does not involves any division or calculation of slope of line. This parameter is however modified by same mechanism as original algorithm but with different value than actual Bresenham algorithm.
This code is generalized in terms of order of input of first point followed by second point or vice versa. Also result is shown in two different form namely, the point form and line segment form.
Any comments and or suggestions for improvement would be appreciated.

Cite As

Chandan Kumar (2021). Bresenham line generation (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R14SP3
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!