nsmryan / bresenham-rs

A fast, iterator-based integer-only implementation of Bresenham's line algorithm in Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bresenham-rs

Implements Bresenham's line drawing algorithm in Rust using an iterator over all points in the line. Most, if not all overhead should evaporate when inlined by the compiler.

Example use:

for (x, y) in Bresenham::new((0, 1), (6, 4)) {
    println!("{}, {}", x, y);
}

Will print:

(0, 1)
(1, 1)
(2, 2)
(3, 2)
(4, 3)
(5, 3)

About

A fast, iterator-based integer-only implementation of Bresenham's line algorithm in Rust.


Languages

Language:Rust 100.0%