Skip to content

fragkakis/bresenham

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

bresenham

This is an implementation of Bresenham's line algorithm.

The implementation is based on the corresponding Wikipedia entry [1], specifically on the "Simplification" variation.

The following is an example of a line from point (3,3) to point (17,7) on a 30x10 2d array.

+++++++++++++++++++++++++++++++++++++++++
+ | | | | | | | | | | | | | | | | | | | +
+ | | | | | | | | | | | | | | | | | | | +
+ | | | | | | | | | | | | | | | | | | | +
+ | | |X|X| | | | | | | | | | | | | | | +
+ | | | | |X|X|X|X| | | | | | | | | | | +
+ | | | | | | | | |X|X|X| | | | | | | | +
+ | | | | | | | | | | | |X|X|X|X| | | | +
+ | | | | | | | | | | | | | | | |X|X| | +
+ | | | | | | | | | | | | | | | | | | | +
+ | | | | | | | | | | | | | | | | | | | +
+++++++++++++++++++++++++++++++++++++++++

[1] http://en.wikipedia.org/wiki/Bresenham's_line_algorithm

Releases

No releases published

Packages

No packages published

Languages