graphics.bresenham_line_basic

Draws a line between two points (x1, y1) and (x2, y2) for slope 0 ≤ m ≤ 1, without floating-point operations.

Reference : https://www.geeksforgeeks.org/dsa/bresenhams-line-generation-algorithm/

>>> classic_bresenham_line((0, 0), (5, 3))
[(0, 0), (1, 1), (2, 1), (3, 2), (4, 2), (5, 3)]

Attributes

x1

Functions

classic_bresenham_line(→ list[tuple[int, int]])

Module Contents

graphics.bresenham_line_basic.classic_bresenham_line(p1: tuple[int, int], p2: tuple[int, int]) list[tuple[int, int]]
graphics.bresenham_line_basic.x1