The document describes algorithms for scan converting primitive geometric objects like lines, circles, and ellipses. It explains Bresenham's line algorithm which uses integer arithmetic to efficiently determine the pixel locations along a line path, getting closer to the actual line than the traditional Digital Differential Analyzer (DDA) algorithm. It also covers the midpoint circle algorithm which uses distance comparison to test the midpoint between pixels to decide if it is inside or outside the circle boundary during scan conversion.
DDA Line Drawing Algorithm
DDA stands for Digital Differential Analyzer
A line drawing algorithm is a graphical algorithm for approximating a line segment on discrete graphical media.
This algorithm is used to draw a line on computer pixels.
what is line
A line in Computer graphics typically refers to line segment, which is a portion of straight line that extends indefinitely in opposite direction.
It is defined by its two end points & the slope intercept equation for a line:
y = mx + b
where, m = Slope of the line
b = the y intercept of a line
This includes different line drawing algorithms,circle,ellipse generating algorithms, filled area primitives,flood fill ,boundary fill algorithms,raster scan fill approaches.
DDA Line Drawing Algorithm
DDA stands for Digital Differential Analyzer
A line drawing algorithm is a graphical algorithm for approximating a line segment on discrete graphical media.
This algorithm is used to draw a line on computer pixels.
what is line
A line in Computer graphics typically refers to line segment, which is a portion of straight line that extends indefinitely in opposite direction.
It is defined by its two end points & the slope intercept equation for a line:
y = mx + b
where, m = Slope of the line
b = the y intercept of a line
This includes different line drawing algorithms,circle,ellipse generating algorithms, filled area primitives,flood fill ,boundary fill algorithms,raster scan fill approaches.
Line Drawing Algorithms - Computer Graphics - NotesOmprakash Chauhan
Straight-line drawing algorithms are based on incremental methods.
In incremental method line starts with a straight point, then some fix incrementable is added to current point to get next point on the line and the same has continued all the end of the line.
Computer graphics - bresenham line drawing algorithmRuchi Maurya
You know that DDA algorithm is an incremental scan conversion method which performs calculations at each step using the results from the preceding step. Here we are going to discover an accurate and efficient raster line generating algorithm, the Bresenham's line-drawing algorithm.
This algorithm was developed by Jack E. Bresenham in 1962 at IBM.
The function given below handles all lines and implements the complete Bresenham's algorithm.
function line(x0, x1, y0, y1)
boolean steep := abs(y1 - y0) > abs(x1 - x0)
if steep then
swap(x0, y0)
swap(x1, y1)
if x0 > x1 then
swap(x0, x1)
swap(y0, y1)
int deltax := x1 - x0
int deltay := abs(y1 - y0)
real error := 0
real deltaerr := deltay / deltax
int y := y0
if y0 < y1 then ystep := 1 else ystep := -1
for x from x0 to x1
if steep then plot(y,x) else plot(x,y)
error := error + deltaerr
if error ? 0.5
y := y + ystep
error := error - 1.0
Line Drawing Algorithms - Computer Graphics - NotesOmprakash Chauhan
Straight-line drawing algorithms are based on incremental methods.
In incremental method line starts with a straight point, then some fix incrementable is added to current point to get next point on the line and the same has continued all the end of the line.
Computer graphics - bresenham line drawing algorithmRuchi Maurya
You know that DDA algorithm is an incremental scan conversion method which performs calculations at each step using the results from the preceding step. Here we are going to discover an accurate and efficient raster line generating algorithm, the Bresenham's line-drawing algorithm.
This algorithm was developed by Jack E. Bresenham in 1962 at IBM.
The function given below handles all lines and implements the complete Bresenham's algorithm.
function line(x0, x1, y0, y1)
boolean steep := abs(y1 - y0) > abs(x1 - x0)
if steep then
swap(x0, y0)
swap(x1, y1)
if x0 > x1 then
swap(x0, x1)
swap(y0, y1)
int deltax := x1 - x0
int deltay := abs(y1 - y0)
real error := 0
real deltaerr := deltay / deltax
int y := y0
if y0 < y1 then ystep := 1 else ystep := -1
for x from x0 to x1
if steep then plot(y,x) else plot(x,y)
error := error + deltaerr
if error ? 0.5
y := y + ystep
error := error - 1.0
system software and application softwareTallat Satti
Software is a general term for the various kinds of programs used to operate computers and related devices. (The term hardware describes the physical aspects of computers and related devices.)
Perform more specialized tasks (word processing, spreadsheets, email, photo editing, bookkeeping)
Installed onto your computer with disk or downloaded
Can be web based, with no need to download program onto computer
Types Of Computer Graphics
Raster Graphics
Primitive drawing using coordinate positions for each pixel
Vector graphics
Primitive drawing using pre-defined mathematical functions
Computer Graphics and its applications, Elements of a Graphics, Graphics Systems: Video Display Devices, Raster Scan Systems, Random Scan Systems, Input devices.
: Introduction of Rendering, Raytracing, Antialiasing, Fractals
This is an introduction to 2D and 3 in computer graphics presented by daroko blog.
• Daroko blog (www.professionalbloggertricks.com)
• Presentation by Daroko blog, to see More tutorials more than this one here, Daroko blog has all tutorials related with IT course, simply visit the site by simply Entering the phrase Daroko blog (www.professionalbloggertricks.com) to search engines such as Google or yahoo!, learn some Blogging, affiliate marketing ,and ways of making Money with the computer graphic Applications(it is useless to learn all these tutorials when you can apply them as a student you know),also learn where you can apply all IT skills in a real Business Environment after learning Graphics another computer relate courses.ly
• Be practically real, not just academic reader
This slide contain description about the line, circle and ellipse drawing algorithm in computer graphics. It also deals with the filled area primitive.
It gives detailed description about Points, Lines, Attributes of Output Primitives, Line Functions, Line Drawing Algorithms, DDA Line drawing algorithms, Bresenham’s Line Algorithm, Circle Generating Algorthims
Graphs of the Sine and Cosine Functions LectureFroyd Wess
More: www.PinoyBIX.org
Lesson Objectives
Able to plot the different Trigonometric Graphs
Graph of Sine Function (y = f(x) = sinx)
Graph of Cosine Function (y = f(x) = cosx)
Define the Maximum and Minimum value in a graph
Generalized Trigonometric Functions
Graphs of y = sinbx
Graphs of y = sin(bx + c)
Could find the Period of Trigonometric Functions
Could find the Amplitude of Trigonometric Functions
Variations in the Trigonometric Functions
International Journal of Computational Engineering Research(IJCER)ijceronline
International Journal of Computational Engineering Research (IJCER) is dedicated to protecting personal information and will make every reasonable effort to handle collected information appropriately. All information collected, as well as related requests, will be handled as carefully and efficiently as possible in accordance with IJCER standards for integrity and objectivity.
2. Output primitives are the basic geometric
structures which facilitate or describe a
scene/picture.
Example of these include:
points, lines, curves (circles, conics etc),
surfaces, fill colour, character string etc.
3. In order to draw the primitive objects, one has to
first scan convert the object.
Scan convert: Refers to the operation of finding
out the location of pixels and then setting the
values of corresponding bits, in the graphic
memory, to the desired intensity code.
4.
5. y means that for a unit (1) change in x
m
x there is
m-change in y.
x 1 means that for a unit (1) change in y
y m there is
1/m change in x.
5
6. Uses differential equation of the line : m
If slope |m| 1 then increment x in steps of 1 pixel and
find corresponding y-values.
If slope |m| 1 then increment y in steps of 1 pixel and
find corresponding x-values.
step through in x step through in y
6
7. A line with positive slope (Left to Right)
If m <= 1, sample at unit x intervals (Δx = 1)
and compute successive y values as:
yk+1 = yk + m.
If m >1, sample at unit y intervals (Δy =1) and
compute successive x values as:
xk+1 = xk + 1/m.
8. A line with positive slope (Right to Left)
If m <= 1, sample at unit x intervals (Δx =-1)
and
compute successive y values as:
yk+1 = yk – m
If m >1, sample at unit y intervals (Δy = -1) and
compute successive x values as:
xk+1 = xk - 1/m
9. A line with negative slope (Left to Right)
If |m| <= 1, sample at unit x intervals (Δx = 1)
and
compute successive y values as:
yk+1 = yk + m
If |m| >1, sample at unit y intervals (Δy =-1)
and compute successive x values as:
xk+1 = xk - 1/m
10. A line with negative slope (Right to Left)
If |m| <=1, sample at unit x intervals (Δx =1)
and
compute successive y values as:
yk+1 = yk - m
If |m| >1, sample at unit y intervals (Δy =1)
and compute successive x values as:
xk+1 = xk + 1/m
11. 1) Accept the end point co-ordinates of the
line segment AB ie A(x1,x2) and B(x2,y2).
2) Calculate dx and dy.
3) If abs(dx)>=abs(dy) then ,
Step=dx else Step=dy.
12. 4) Let x increment = dx/Step ;
Let y increment = dy/Step.
5) Display the pixels at standing portion put
pixel (x,y,white).
6) Compute the next co-ordinate position along
the line path
xk+1 = xk + x increment
yk+1 = yk + y increment
Put Pixel(xk+1 , yk+1 ,white).
13. 7) If xk+1=x2 OR / AND yk+1=y2
then STOP else go to Step (4).
14.
15. 1) In Bresenham’s Line Drawing Algorithm the
pixel positions along a line path are obtained by
determining the pixel i.e nearer the line at each
step.
2) It is an efficient raster line generation
algorithm.
16. 1) Accept the end point co-ordinates of the
line segment AB ie A(x1,x2) and B(x2,y2).
2) Calculate dx and dy.
3) If abs(dy)<=abs(dx) ie slope |m|<=1
(a) Compute initial decision parameter
Po= 2abs(dy)-abs(dx).
17. (b) At each xk position perform the following
if Pk <0 i.e d1< d2 then,
x increment=dx/abs(dx) AND y increment=0
Pk+1= Pk + 2abs(dy)
else,
Pk >0 ie d1>d2
X increment =dx/abs(dx)
Y increment =dy/abs(dy)
Pk+1= Pk +2abs(dy)-2abs(dx).
18. 4) If abs(dy) > abs(dx) ie slope |m|>1
(a) Compute initial decision parameter
Po= 2abs(dx)-abs(dy)
(b) At each xk position,perform the following if
Pk < 0 i.e d1 < d2 then
x increment=0
y increment=dy/abs(dy)
Pk+1= Pk + 2abs(dx)
19. Else,
Pk >0 ie d1>d2
X increment=dx/abs(dx)
Y increment=dy/abs(dy)
Pk+1= Pk +2abs(dx)-2abs(dy).
5) Calculate : xnext = xk + x increment
ynext = yk + y increment.
Display (xk+1, yk+1, white).
20. 6) Repeat Step (3) to (5) until
xk+1=x2 AND /OR yk+1 =y2
7)STOP.
22. Mid-point Circle Algorithm
A method for direct distance comparison is
to test the halfway position between two
pixels to determine if this midpoint is inside
or outside the circle boundary.
This method is more easily applied to
other conics, and for an integer circle
radius.
23. 1) Accept the radius r and center (xc, yc).The
point of the circumference of a circle with
center as origin (x0, y0) =(0,r).
2) Calculate the initial decision parameter as
Po =5/4 –r .
3) At each xk position starting at k=0.Perform
the following test.
24. If Pk <0 then,
Xk+1= xk +1 and yk+1= yk
Pk+1 = Pk +2xk +3
Otherwise, Pk >0
Xk+1= xk +1 and Yk+1= yk -1
Pk+1= Pk +2( xk - yk ) +5
4) Determine the symmetric points in other 7
octants.
25. 5) Translate each calculated pixel position by
T ( xk , yk ) and display the pixel
X= xk+1 + xc AND Y= yk+1 + yc
Put pixel ( x,y, white).
6) Repeat step (3) to step (5) until x>=y.
7)STOP.
27. 1) Accept the radius r and center (xc, yc).The
point of the circumference of a circle with center
as origin (x0, y0) =(0,r).
2) Calculate the initial decision parameter as
PO =3 – 2r.
3) At each xk position starting at k=0.Perform
the following test.
28. If Pk <0 then,
Xk+1= xk +1 and yk+1= yk
Pk+1 = Pk +4xk +6.
Otherwise, Pk > 0
Xk+1= xk +1 AND Yk+1= yk -1
Pk+1= Pk +4( xk - yk ) +10
4) Determine the symmetric points in other 7
octants.
29. 5) Translate each calculated pixel position by
T ( xk , yk ) and display the pixel
X= xk+1 + xc AND Y= yk+1 + yc
Put pixel ( x, y, white)
6) Repeat step (3) to step (5) until x>=y
7) STOP.
30. The DDA algorithm is accomplished by taking
unit step in one direction and calculating other.
The Bresenham’s Algorithm finds the closest
integer co-ordinate to the actual part.
DDA algorithm uses floating point calculation.
Bresenham’s uses integer point calculation.
DDA is more accurate compared to
Bresenhams.
31. Circles and ellipses can be efficiently and
accurately scan converted using midpoint
methods.
Bresenham’s line algorithm and the midpoint
line algorithm methods are the most efficient.