{"id":35,"date":"2018-07-20T04:42:26","date_gmt":"2018-07-20T04:42:26","guid":{"rendered":"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/?post_type=chapter&#038;p=35"},"modified":"2018-12-26T11:50:56","modified_gmt":"2018-12-26T11:50:56","slug":"output-primitives-dda-line-drawing-procedure","status":"publish","type":"chapter","link":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/chapter\/output-primitives-dda-line-drawing-procedure\/","title":{"rendered":"Output Primitives\u2013DDA line Drawing procedure"},"content":{"raw":"<div><span style=\"float: right\"><a href=\"https:\/\/youtu.be\/OXpkzdysFd4\" target=\"_blank\" rel=\"noopener\"><img src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"epgp books\" width=\"75px\" height=\"75px;\" \/><\/a>\r\n<\/span><\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n<strong>Objectives:<\/strong>\r\n<p style=\"text-align: justify\">Understand how a line is drawn using DDA line drawing procedure<\/p>\r\n&nbsp;\r\n\r\n<strong>Basic Building blocks of a picture:<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">A primitive is a small component of a picture. A picture is an aggregation of basic building blocks as shown here. Some of the basic building blocks under discussion are Points, lines, triangle, plane circle, ellipse, arcs, splines, NURBS, fractals. A picture is some combination of these primitives.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-37 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-10.png\" alt=\"\" width=\"248\" height=\"161\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">A point is a location in space. It has no dimension theoretically. A point can be easily plotted on a monitor only if its abscissa and ordinate are both integers.<\/p>\r\n<img class=\"size-full wp-image-39 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-11.png\" alt=\"\" width=\"215\" height=\"151\" \/>\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\"><strong>Lines: <\/strong>A line is a collection of points along a particular direction.Given two end points, the line drawing algorithm has to find the intermediate points which could be plotted. A monitor is a device that has got a rectangular arrangement of pixels. A pixel is identified or located using an x-position and a y-position. i.e., a pixel position can be identified as say (25, 40), the reference position being the top left corner as we start counting pixels from top left corner. Moreover we have pixel positions which are integer values only i.e. there is no\u00a0<span style=\"font-size: 1em;text-align: initial\">position like (10.4, 20.7) which can be plotted. We have to either round it off or trim the fractions.<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>Line drawing algorithms:<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The two popular line drawing procedures are given here. DDA is a rudimentary level procedure and is less accurate, while Bresenham\u2019s procedure is more accurate.<\/p>\r\n\r\n<ul>\r\n \t<li>DDA (Digital Differential Analyzer)<\/li>\r\n \t<li>BRESENHAM<\/li>\r\n<\/ul>\r\n&nbsp;\r\n<p style=\"text-align: justify\">An efficient algorithm is one that has less computational complexity and draws accurate lines. Lines can be represented in equations by using slope-point form, slope-intercept form or parametric form.<\/p>\r\n&nbsp;\r\n\r\n<strong>DDA (Digital Differential Analyzer) LINE DRAWING ALGO:<\/strong>\r\n<ul>\r\n \t<li>Based on slope\u2013point form of line equation<\/li>\r\n \t<li>Simple<\/li>\r\n \t<li>Scan conversion based<\/li>\r\n \t<li>Less efficient<\/li>\r\n<\/ul>\r\n<img class=\"size-full wp-image-40 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-12.png\" alt=\"\" width=\"232\" height=\"172\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Let\u2019s imagine various line type as shown. The blue color dot represents the starting point of the line and the red dot represents the endpoint. The line types 1 and 3 are more inclined towards X-axis. Line type 2 and 4 are more inclined towards y-axis. Line types 1, 2 and 5 have positive slopes with type 5 having a slope of 1, while line types 3, 4 have negative slopes. We can characterize the line types as shown below. These are the possible lines that we can draw in 2D space. Here \u2018m\u2019 is the slope and computed as ratio of <em>dy<\/em>, <em>dx<\/em>.<\/p>\r\n&nbsp;\r\n\r\n<img class=\" wp-image-41 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-13.png\" alt=\"\" width=\"312\" height=\"232\" \/>\r\n<p style=\"text-align: justify\">As line types (1) and (3) are more inclined towards X-axis it makes sense to sample them along X-axis at the highest possible sampling frequency which is 1. Line types (2) and (4) are more inclined towards Y-axis it makes sense to sample them along Y-axis at the\u00a0<span style=\"font-size: 1em;text-align: initial\">highest possible sampling frequency which is 1. The line type (5) can be sampled either along x-axis or along y-axis. For simplicity we can sample the line type (5) also along x-axis. We can devise simple procedures that compute points along the line path, given the two end points. The closer we compute the points along the line path, the better is the approximation for the true line path. That is we are concerned about the highest possible sampling frequency, which is one-pixel distance. See figure.<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n<p style=\"text-align: justify\">We adopt different procedures, for different line types. When the lines are more inclined towards x-axis (|m|&lt;=1), we will sample the line along x-axis at unit x-intervals, and compute the corresponding y as shown above and below.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">When the lines are more inclined towards x-axis (|m|&gt;1), we will sample the line along y-axis at unit y-intervals, and compute the corresponding x as shown below. As can be observed from the figure above, for line type (1), (3), three in-between points (shown in green) need to be computed, while for line type (5) two in-between points need to be computed.<\/p>\r\n&nbsp;\r\n\r\nGiven two end points P1(x1, y1) and P2(x2, y2)\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\nFor any two consecutive points along the line say (xk,yk) and (xk+1,yk+1)\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-42 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-14.png\" alt=\"\" width=\"206\" height=\"47\" \/>\r\n<p style=\"text-align: justify\">Where <em>k<\/em> takes integer values from 1 or 0 for the first point and increases by 1 until the final end point is reached. The next x value is indicated as Xk+1 while the next y value is indicated as yk+1. When we are sampling along x-axis next x given xk is xk+1 and when we are sampling along x-axis next x given yk is yk+1.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-43 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-15.png\" alt=\"\" width=\"511\" height=\"553\" \/>\r\n\r\n<\/div>\r\n&nbsp;\r\n\r\n<strong style=\"text-align: initial;font-size: 1em\">DDA procedure:<\/strong>\r\n<div>\r\n<ul>\r\n \t<li>Input the end points<\/li>\r\n \t<li>Compute slope<\/li>\r\n \t<li style=\"text-align: justify\">Depending on the magnitude of slope, decide whether to increment along X-axis or Y-axis by unit steps and compute corresponding points on the other axis<\/li>\r\n \t<li>Round the computed values to the nearest integer for plotting<\/li>\r\n<\/ul>\r\n<p style=\"text-align: justify\"><strong>Ex: Problem: <\/strong>Given two end points (2, 2) and (10, 5). Find the intermediate points using DDA line drawing algo.<\/p>\r\n&nbsp;\r\n\r\n<strong>Sol: <\/strong>Compute Slope m=3\/8=0.375 &lt;1\r\n\r\nSince m&lt;1 use eq.s of case (i) xk+1=xk+1, yk+1=yk+m\r\n\r\nThe starting position on the line is at (X0, Y0) = (2, 2), so next x is 3 and next is 4 and so on.\r\n\r\nThe intermediate points are computed as shown.\r\n\r\n&nbsp;\r\n\r\nY1=2+0.375\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">Y2=2.375+0.375<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">Y3=2.750+0.375<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">\u2026\u2026<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">\u2026\u2026<\/span>\r\n\r\n<\/div>\r\n<p style=\"text-align: justify\">i.e., for computation we use floating point values and for plotting we will be rounding off the values.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-44 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-16.png\" alt=\"\" width=\"403\" height=\"337\" \/>\r\n\r\nDrawbacks of DDA\r\n<ul>\r\n \t<li>Stair-Step or Jaggy effect<\/li>\r\n \t<li>Floating point calculations<\/li>\r\n \t<li>For longer lines DDA line drifts away from true line<\/li>\r\n<\/ul>\r\n&nbsp;\r\n\r\n<strong>Summary:<\/strong>\r\n<ul>\r\n \t<li>Learnt how to draw a line given two end points using DDA procedure<\/li>\r\n \t<li>Understood the pros and cons of the DDA procedure<\/li>\r\n<\/ul>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-45 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-17.png\" alt=\"\" width=\"643\" height=\"329\" \/>\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td><strong>you can view video on Output Primitives\u2013DDA line Drawing procedure<\/strong><\/td>\r\n<td><a href=\"https:\/\/youtu.be\/OXpkzdysFd4\" target=\"_blank\" rel=\"noopener\"><img class=\"alignnone wp-image-120\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"\" width=\"36\" height=\"36\" \/><\/a><\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>","rendered":"<div><span style=\"float: right\"><a href=\"https:\/\/youtu.be\/OXpkzdysFd4\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"epgp books\" width=\"75px\" height=\"75px;\" \/><\/a><br \/>\n<\/span><\/div>\n<div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Objectives:<\/strong><\/p>\n<p style=\"text-align: justify\">Understand how a line is drawn using DDA line drawing procedure<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Basic Building blocks of a picture:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">A primitive is a small component of a picture. A picture is an aggregation of basic building blocks as shown here. Some of the basic building blocks under discussion are Points, lines, triangle, plane circle, ellipse, arcs, splines, NURBS, fractals. A picture is some combination of these primitives.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-37 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-10.png\" alt=\"\" width=\"248\" height=\"161\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-10.png 248w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-10-65x42.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-10-225x146.png 225w\" sizes=\"auto, (max-width: 248px) 100vw, 248px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">A point is a location in space. It has no dimension theoretically. A point can be easily plotted on a monitor only if its abscissa and ordinate are both integers.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-39 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-11.png\" alt=\"\" width=\"215\" height=\"151\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-11.png 215w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-11-65x46.png 65w\" sizes=\"auto, (max-width: 215px) 100vw, 215px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><strong>Lines: <\/strong>A line is a collection of points along a particular direction.Given two end points, the line drawing algorithm has to find the intermediate points which could be plotted. A monitor is a device that has got a rectangular arrangement of pixels. A pixel is identified or located using an x-position and a y-position. i.e., a pixel position can be identified as say (25, 40), the reference position being the top left corner as we start counting pixels from top left corner. Moreover we have pixel positions which are integer values only i.e. there is no\u00a0<span style=\"font-size: 1em;text-align: initial\">position like (10.4, 20.7) which can be plotted. We have to either round it off or trim the fractions.<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>Line drawing algorithms:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The two popular line drawing procedures are given here. DDA is a rudimentary level procedure and is less accurate, while Bresenham\u2019s procedure is more accurate.<\/p>\n<ul>\n<li>DDA (Digital Differential Analyzer)<\/li>\n<li>BRESENHAM<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">An efficient algorithm is one that has less computational complexity and draws accurate lines. Lines can be represented in equations by using slope-point form, slope-intercept form or parametric form.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>DDA (Digital Differential Analyzer) LINE DRAWING ALGO:<\/strong><\/p>\n<ul>\n<li>Based on slope\u2013point form of line equation<\/li>\n<li>Simple<\/li>\n<li>Scan conversion based<\/li>\n<li>Less efficient<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-40 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-12.png\" alt=\"\" width=\"232\" height=\"172\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-12.png 232w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-12-65x48.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-12-225x167.png 225w\" sizes=\"auto, (max-width: 232px) 100vw, 232px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Let\u2019s imagine various line type as shown. The blue color dot represents the starting point of the line and the red dot represents the endpoint. The line types 1 and 3 are more inclined towards X-axis. Line type 2 and 4 are more inclined towards y-axis. Line types 1, 2 and 5 have positive slopes with type 5 having a slope of 1, while line types 3, 4 have negative slopes. We can characterize the line types as shown below. These are the possible lines that we can draw in 2D space. Here \u2018m\u2019 is the slope and computed as ratio of <em>dy<\/em>, <em>dx<\/em>.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-41 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-13.png\" alt=\"\" width=\"312\" height=\"232\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-13.png 144w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-13-65x48.png 65w\" sizes=\"auto, (max-width: 312px) 100vw, 312px\" \/><\/p>\n<p style=\"text-align: justify\">As line types (1) and (3) are more inclined towards X-axis it makes sense to sample them along X-axis at the highest possible sampling frequency which is 1. Line types (2) and (4) are more inclined towards Y-axis it makes sense to sample them along Y-axis at the\u00a0<span style=\"font-size: 1em;text-align: initial\">highest possible sampling frequency which is 1. The line type (5) can be sampled either along x-axis or along y-axis. For simplicity we can sample the line type (5) also along x-axis. We can devise simple procedures that compute points along the line path, given the two end points. The closer we compute the points along the line path, the better is the approximation for the true line path. That is we are concerned about the highest possible sampling frequency, which is one-pixel distance. See figure.<\/span><\/p>\n<\/div>\n<div>\n<p style=\"text-align: justify\">We adopt different procedures, for different line types. When the lines are more inclined towards x-axis (|m|&lt;=1), we will sample the line along x-axis at unit x-intervals, and compute the corresponding y as shown above and below.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">When the lines are more inclined towards x-axis (|m|&gt;1), we will sample the line along y-axis at unit y-intervals, and compute the corresponding x as shown below. As can be observed from the figure above, for line type (1), (3), three in-between points (shown in green) need to be computed, while for line type (5) two in-between points need to be computed.<\/p>\n<p>&nbsp;<\/p>\n<p>Given two end points P1(x1, y1) and P2(x2, y2)<\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p>For any two consecutive points along the line say (xk,yk) and (xk+1,yk+1)<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-42 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-14.png\" alt=\"\" width=\"206\" height=\"47\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-14.png 206w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-14-65x15.png 65w\" sizes=\"auto, (max-width: 206px) 100vw, 206px\" \/><\/p>\n<p style=\"text-align: justify\">Where <em>k<\/em> takes integer values from 1 or 0 for the first point and increases by 1 until the final end point is reached. The next x value is indicated as Xk+1 while the next y value is indicated as yk+1. When we are sampling along x-axis next x given xk is xk+1 and when we are sampling along x-axis next x given yk is yk+1.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-43 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-15.png\" alt=\"\" width=\"511\" height=\"553\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-15.png 511w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-15-277x300.png 277w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-15-65x70.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-15-225x243.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-15-350x379.png 350w\" sizes=\"auto, (max-width: 511px) 100vw, 511px\" \/><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p><strong style=\"text-align: initial;font-size: 1em\">DDA procedure:<\/strong><\/p>\n<div>\n<ul>\n<li>Input the end points<\/li>\n<li>Compute slope<\/li>\n<li style=\"text-align: justify\">Depending on the magnitude of slope, decide whether to increment along X-axis or Y-axis by unit steps and compute corresponding points on the other axis<\/li>\n<li>Round the computed values to the nearest integer for plotting<\/li>\n<\/ul>\n<p style=\"text-align: justify\"><strong>Ex: Problem: <\/strong>Given two end points (2, 2) and (10, 5). Find the intermediate points using DDA line drawing algo.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Sol: <\/strong>Compute Slope m=3\/8=0.375 &lt;1<\/p>\n<p>Since m&lt;1 use eq.s of case (i) xk+1=xk+1, yk+1=yk+m<\/p>\n<p>The starting position on the line is at (X0, Y0) = (2, 2), so next x is 3 and next is 4 and so on.<\/p>\n<p>The intermediate points are computed as shown.<\/p>\n<p>&nbsp;<\/p>\n<p>Y1=2+0.375<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">Y2=2.375+0.375<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">Y3=2.750+0.375<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">\u2026\u2026<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">\u2026\u2026<\/span><\/p>\n<\/div>\n<p style=\"text-align: justify\">i.e., for computation we use floating point values and for plotting we will be rounding off the values.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-44 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-16.png\" alt=\"\" width=\"403\" height=\"337\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-16.png 403w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-16-300x251.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-16-65x54.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-16-225x188.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-16-350x293.png 350w\" sizes=\"auto, (max-width: 403px) 100vw, 403px\" \/><\/p>\n<p>Drawbacks of DDA<\/p>\n<ul>\n<li>Stair-Step or Jaggy effect<\/li>\n<li>Floating point calculations<\/li>\n<li>For longer lines DDA line drifts away from true line<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>Summary:<\/strong><\/p>\n<ul>\n<li>Learnt how to draw a line given two end points using DDA procedure<\/li>\n<li>Understood the pros and cons of the DDA procedure<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-45 aligncenter\" src=\"http:\/\/csp06.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/52\/2018\/07\/1-17.png\" alt=\"\" width=\"643\" height=\"329\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-17.png 643w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-17-300x153.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-17-65x33.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-17-225x115.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-content\/uploads\/sites\/52\/2018\/07\/1-17-350x179.png 350w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>you can view video on Output Primitives\u2013DDA line Drawing procedure<\/strong><\/td>\n<td><a href=\"https:\/\/youtu.be\/OXpkzdysFd4\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-120\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"\" width=\"36\" height=\"36\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"author":3,"menu_order":2,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":["dr-t-raghuveera"],"pb_section_license":""},"chapter-type":[],"contributor":[59],"license":[],"class_list":["post-35","chapter","type-chapter","status-publish","hentry","contributor-dr-t-raghuveera"],"part":3,"_links":{"self":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/pressbooks\/v2\/chapters\/35","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/wp\/v2\/users\/3"}],"version-history":[{"count":11,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/pressbooks\/v2\/chapters\/35\/revisions"}],"predecessor-version":[{"id":596,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/pressbooks\/v2\/chapters\/35\/revisions\/596"}],"part":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/pressbooks\/v2\/chapters\/35\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/wp\/v2\/media?parent=35"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/pressbooks\/v2\/chapter-type?post=35"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/wp\/v2\/contributor?post=35"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp06\/wp-json\/wp\/v2\/license?post=35"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}