SkillAgentSearch skills...

Bresenham

Bresenham's line algorithm

Install / Use

/learn @fragkakis/Bresenham
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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.

<pre> +++++++++++++++++++++++++++++++++++++++++ + | | | | | | | | | | | | | | | | | | | + + | | | | | | | | | | | | | | | | | | | + + | | | | | | | | | | | | | | | | | | | + + | | |X|X| | | | | | | | | | | | | | | + + | | | | |X|X|X|X| | | | | | | | | | | + + | | | | | | | | |X|X|X| | | | | | | | + + | | | | | | | | | | | |X|X|X|X| | | | + + | | | | | | | | | | | | | | | |X|X| | + + | | | | | | | | | | | | | | | | | | | + + | | | | | | | | | | | | | | | | | | | + +++++++++++++++++++++++++++++++++++++++++ </pre>

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

View on GitHub
GitHub Stars12
CategoryDevelopment
Updated5y ago
Forks4

Languages

Java

Security Score

60/100

Audited on Aug 29, 2020

No findings