Skip to content

Add : DDA algorithm#1007

Closed
Kunal-Khairnar-05 wants to merge 1 commit into
TheAlgorithms:masterfrom
Kunal-Khairnar-05:master
Closed

Add : DDA algorithm#1007
Kunal-Khairnar-05 wants to merge 1 commit into
TheAlgorithms:masterfrom
Kunal-Khairnar-05:master

Conversation

@Kunal-Khairnar-05

@Kunal-Khairnar-05 Kunal-Khairnar-05 commented Oct 7, 2022

Copy link
Copy Markdown

Description of Change

References

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:

Comment thread graphics/DDA_Algorithm.c
Comment on lines +3 to +6
#include <graphics.h>
#include <stdio.h>
#include <conio.h>
#include <math.h>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a one-line description of what the library/header is for (see the example below).

#include <stdio.h>     /// for IO operations
#include <assert.h>    /// for assert

Comment thread graphics/DDA_Algorithm.c
@@ -0,0 +1,46 @@
// DDA line drawing algorithm

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please describe how the algorithm works, a Wikipedia link, what the algorithm does, etc..

Comment thread graphics/DDA_Algorithm.c
Comment thread graphics/DDA_Algorithm.c
Comment on lines +21 to +35
dx = x2 - x1;
dy = y2 - y1;

if (abs(dx) > abs(dy))
steps = abs(dx);
else
steps = abs(dy);

xinc = dx / (float) steps;
yinc = dy / (float) steps;

x = x1;
y = y1;

putpixel(x, y, 15);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate the code into functions and structures if needed as well as add self-test cases using assert (requires the assert.h library/header).

@Panquesito7 Panquesito7 added enhancement New feature or request Changes requested Proper Documentation Required requested to write the documentation properly Autochecks are failing Failing CI Auto-checks labels Oct 26, 2022
@github-actions

github-actions Bot commented Jan 1, 2023

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the Stale label Jan 1, 2023
@github-actions

github-actions Bot commented Jan 9, 2023

Copy link
Copy Markdown
Contributor

Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

@github-actions github-actions Bot closed this Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Autochecks are failing Failing CI Auto-checks Changes requested enhancement New feature or request Proper Documentation Required requested to write the documentation properly Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants