Bresenham line generation

Draws line using Bresenham line generation algorithm
1.1K Downloads
Updated 9 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 (2024). Bresenham line generation (https://www.mathworks.com/matlabcentral/fileexchange/25543-bresenham-line-generation), MATLAB Central File Exchange. Retrieved .

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!
Version Published Release Notes
1.0.0.0