Sunday, 28 February 2016

DDA LINE ALGORITHM

DDA Line ( X1, Y1, XN, YN):
Description: Here X1 and Y1 denote the starting x – coordinate and y – coordinate of the line
and XN and YN denote the ending x – coordinate and y – coordinate.


1. Set M = (YN – Y1) / (XN – X1) [Calculate slope of line]
2. Repeat For I = X1 to XN
3. If (M <= 1) Then
4. Set DX = 1
5. Set DY = M * DX
6. Else
7. Set DY = 1
8. Set DX = DY / M
[End of If]
9. Set X1 = X1 + DX
10. Set Y1 = Y1 + DY
11. Call PutPixel(X1, Y1)
[End of For]
12. Exit

Related Posts:

  • C programm to add two numbers #include<stdio.h> #include<conio.h> void main() { int a,b,sum=0; clrscr(); /*printf("1st number \n"); scanf("%d \n",&a); printf("2nd number \n"); scanf("%d \n",&b); sum=a+b; printf("\n %d sum=",&sum);… Read More
  • Manpower Management DEFINITION:-— Manpower Planning which is also called as Human Resource Planning consists of putting right number of people, right kind of people at the right place, right time, doing the right things for which they are su… Read More
  • Importance of Training What is traning? Training focuses on specific job knowledge and skill that is to be applied in the short run.  Development focuses on broad knowledge and insights that may be required for adaptation to environmental… Read More
  • Importance of Manpower Importance of Manpower —Key to managerial functions- Human resources help in the implementation of all these managerial activities. Therefore, staffing becomes a key to all managerial functions.  —Efficient uti… Read More
  • Need of Manpower —Manpower Planning is a two-phased process because manpower planning not only analyses the current human resources but also makes manpower forecasts and thereby draw employment programs. Manpower Planning is advantageous to… Read More