Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f66b82b

Browse files
author
Amogh Singhal
authored
Update bresenham_line_algorithm.py
1 parent f0d293d commit f66b82b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎bresenham_line_algorithm.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# 3. The equation of the straight line is y = m*x+c. So the next thing we need to find is the intercept c
1313
# 4. Intercept can be derived using the formula c = y1 - m*x1
1414
# 5. To get the next point, we add dx to the x-cordinate and dy to the y cordinate
15+
# 6. We continue this cycle until we reach (x2, y2)
1516

1617
def lineGenerator(x1, y1, x2, y2):
1718
dx = x2 - x1

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /