100% found this document useful (1 vote)
328 views

Solution-: Calculate The Points Between The Starting Point (5, 6) and Ending Point (13, 10) - Using DDA Algorithm

Zaid bin Shafi calculates points along a line between a starting point (5,6) and ending point (13,10) using the Digital Differential Analyzer (DDA) algorithm. The steps are: 1) Calculate the change in x (ΔX) and change in y (ΔY) between points, and the slope (M) 2) Determine the number of steps as the maximum of ΔX or ΔY 3) Calculate intermediate points by incrementing x and y based on M until the ending point is reached Zaid provides a table showing the calculated intermediate points.

Uploaded by

zaid bin shafi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
328 views

Solution-: Calculate The Points Between The Starting Point (5, 6) and Ending Point (13, 10) - Using DDA Algorithm

Zaid bin Shafi calculates points along a line between a starting point (5,6) and ending point (13,10) using the Digital Differential Analyzer (DDA) algorithm. The steps are: 1) Calculate the change in x (ΔX) and change in y (ΔY) between points, and the slope (M) 2) Determine the number of steps as the maximum of ΔX or ΔY 3) Calculate intermediate points by incrementing x and y based on M until the ending point is reached Zaid provides a table showing the calculated intermediate points.

Uploaded by

zaid bin shafi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Zaid bin shafi 19bcs9504

ASSITGMENT 1

COMPUTER GRAPHICS

Name :Zaid bin Shafi section:cse-20

Uid:19BCS9504 subject code:CST-305

Q2: Calculate the points between the starting point (5, 6) and ending point (13, 10).
Using DDA algorithm.

Solution-
 
Given-

 Starting coordinates = (X0, Y0) = (5, 6)


 Ending coordinates = (Xn, Yn) = (13, 10)
 

Step-01:
 
Calculate ΔX, ΔY and M from the given input.
 ΔX = Xn – X0 = 13 – 5 = 8
 ΔY =Yn – Y0 = 10 – 6 = 4
 M = ΔY / ΔX = 4 / 8 = 0.50
Step-02:
 
Calculate the number of steps.
As |ΔX| > |ΔY| = 8 > 4, so number of steps = ΔX = 8
 
Zaid bin shafi 19bcs9504

Step-03:
 
As M < 1, so case-01 is satisfied.
Now, Step-03 is executed until Step-04 is satisfied.
 

Xp Yp Xp+1 Yp+1 Round off (Xp+1, Yp+1)

5 6 6 6.5 (6, 7)

7 7 (7, 7)

8 7.5 (8, 8)

9 8 (9, 8)

10 8.5 (10, 9)

11 9 (11, 9)

12 9.5 (12, 10)

13 10 (13, 10)
Zaid bin shafi 19bcs9504

You might also like