Skip to content

Commit 7ce5261

Browse files
Apply suggestions from code review
1 parent ac7607e commit 7ce5261

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

graphics/digital_differential_analyzer_line.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22

33

44
def digital_differential_analyzer_line(
5-
x1: int, y1: int, x2: int, y2: int
5+
p1: tuple[int, int], p2: tuple[int, int]
66
) -> list[tuple[int, int]]:
77
"""
88
Draws a line between two points using the DDA algorithm.
99
1010
Args:
11-
- x1, y1: Coordinates of the starting point.
12-
- x2, y2: Coordinates of the ending point.
13-
11+
- p1: Coordinates of the starting point.
12+
- p2: Coordinates of the ending point.
1413
Returns:
1514
- List of coordinate points that form the line.
1615
1716
>>> digital_differential_analyzer_line(1, 1, 4, 4)
1817
[(2, 2), (3, 3), (4, 4)]
1918
"""
20-
19+
x1, y1 = p1
20+
x2, y2 = p2
2121
dx = x2 - x1
2222
dy = y2 - y1
2323
steps = max(abs(dx), abs(dy))

0 commit comments

Comments
 (0)