MODULE - 4. e-pg Pathshala

Size: px
Start display at page:

Download "MODULE - 4. e-pg Pathshala"

Transcription

1 e-pg Pathshala MODULE - 4 Subject : Computer Science Paper: Computer Graphics and Visualization Module: Midpoint Circle Drawing Procedure Module No: CS/CGV/4 Quadrant 1 e-text Before going into the Midpoint circle drawing procedure, Lets solve an example problem, to understand how Bresenham s procedure works for various lines. Consider examples as below. Example Problem -1: (When m <=1 and m is +ve) Problem: Scan convert the line between (2, 2) and (10, 5) using Bresenham s algorithm Sol: Since the line has a slope m=3/8 =0.375 the following set of equations would be valid P 0 =2 y- x, y=3, x=8 P 0 =6-8=-2 Represent first pixel as (X 0,Y 0 ) =(2,2). P 0 =-2, since, P 0 ve use case (i) i.e. next pixel is (X 1,Y 1 ) =(X 0 +1,Y 0 )=(3,2) and Compute P 1 =P 0 +2*3 = -2+6=4, P 1 +ve use case (ii) K P k X k+1 Y K Example Problem -2: (When m <=1 and m is -ve) Problem: Scan convert the line between (2, 8) and (10, 5) using Bresenham s algorithm Sol: y = -3, x = 8

2 Since the line has a slope m=-3/8= i.e. m <1 the same set of equations used for the previous example would be valid. P 0 =2 y - x y =3 x =8 P 0 =6-8=-2 Represent first pixel as (X 0,Y 0 ) =(2,8) P 0 =-2 use case (i) i.e. next pixel is (X 1,Y 1 )=(X 0 +1,Y 0 )=(3,8) and compute P 1 =P 0 +2*3 = -2+6=4 Since P 1 is +ve use case (ii) so next pixel to be plotted is (4,7) P 2 =4+2x3-2x8 = -6 Since P 2 is ve, the next pixel to be plotted is (5, 7) and continue till we reach the end of line. K P k X k+1 Y K Note that even if y is ve, we consider only the magnitude for all computations Observe that while x is increasing in increments of 1 from 3 to 9, while y is decreasing from 8 to 5 as per the algorithm. Conclusion: Important observation while working with negative slopes is that do always compute magnitudes for Δx and Δy i.e. Δx and Δy and never consider signs. Observe always that P k should fluctuate about +ve and -ve For Longer lines DDA line drifts away from the true line. Bresenham s line fluctuates about the theoretical line. Bresenham s line better approximates the theoretical line i.e., it never deviates from the theoretical line. No floating point calculations are involved.

3 Summary: Outlined the Bresenham s line drawing procedure Noted the advantages of the procedure over DDA procedure. Midpoint Circle Drawing Procedure: We have started with the first primitive, points, followed by lines, now followed by the third primitive of interest, the circle. A circle is fundamentally symmetric and exhibits octant symmetry. i.e. a circle is symmetric about its octants. If we know a point on any one of the octants the remaining 7 symmetric points can be plotted by interchanging magnitudes of x and y and also signs Lets try to understand what octant symmetry is through the following diagram. As shown in the diagram above, divide the circle into 8 parts (each is an octant) using 4 axes. Assume that we know a point say (2, 7) on one of the octants, the remaining 7 symmetric points on the seven octants can be easily plotted without making any computations. If we fold the octants about an axis, the octant exactly overlaps on the neighbouring octant due to symmetry. It is enough that we compute points on one of the octants. The remaining points can be easily plotted without any computations. Assuming the circle is centered at origin and has a radius r units, the algorithm can start with a known point (0, r) and proceed to compute points till the end of the octant is reached. For convenience, we shall chose the first octant i.e. that octant in which the relation x<y is satisfied. We need to compute points on part of the circle shown in the diagram. How do we know where to stop so that the end of the octant is reached? We need to find out the stopping condition for the algorithm. The?? Symbols shown in the diagram represent the last

4 point on the chosen octant at which we should stop. Moreover the point (??) might lie on the axis which satisfies the equation, x=y, that means all points that lie on that axis are like, (2,2) (3,3) and so on. This axis divides the first positive quadrant into two zones or two octants. All points on the upper side of the axis satisfy the relation x<y, while all the points on the lower side of the axis satisfy the relation x>y. That is to fix our stopping condition as we go on computing points, it is just sufficient that we check the relation between x and y, i.e., as long as x<=y we can do our computation, and stop when the relation x<=y is not satisfied by the points. Also observe that in the chosen octant, while we proceed to compute points on the circle boundary, the slope of the circle changes from 0 (positive) to -1 (negative). While x increases, y decreases. Because the circle has slope that is almost flat, we can sample the circle along x-axis at unit steps and compute the corresponding y-values. Start at (0,r) End at (x,y) such that x>=y i.e. whenever x becomes >=y we can stop the algo. Because the shape of the circle in this region is more flat, we can sample it along X- axis at unit intervals, and compute the corresponding y-values. What is the principle behind Midpoint Circle drawing procedure? Equation of circle with centre at origin, and having a radius of r units is given by x 2 +y 2 =r 2. We can start with a known point on the circle say (x k,y k ) in the chosen octant. Let the next point to be computed be represented as (x k+1,y k+1 ). Since we are sampling on x-axis at unit x-intervals, it is evident that the next x, x k+1 = x k +1. As we know from theory that any point x, y that satisfy the relation x 2 +y 2 -r 2 <0 is a point that lies inside the circle boundary x 2 +y 2 -r 2 >0 is a point that lies outside the circle boundary x 2 +y 2 -r 2 =0 is a point that lies on the circle boundary

5 For the next x position x k +1, we can choose between two y positions y k or y k -1. Compute midpoint for the two possible pixel locations (x k +1, y k ) (x k +1, y k -1) and verify its position relative to the circle boundary. If the midpoint lies inside the circle boundary choose to plot the upper pixel else the lower pixel. The coordinates of the midpoint are for the two possible pixels positions (x k +1, y k ) or (x k +1, y k -1) are (x k + 1, y k 1 2 ) Now by substituting the coordinates of the midpoint, in the circle equation, we can check whether the midpoint lies inside, outside or on the circle boundary. Thus the decision parameter P k for our derivation is given by P k = (x k + 1) 2 + (y k 1 2 )2 r 2 i.e., P k <0, means that midpoint is inside the circle boundary, so the circle boundary is close to the upper pixel, thus choose the upper pixel (x k +1, y k ) for plotting, otherwise if P k >0, the midpoint is outside the circle boundary, so the circle boundary is close to the lower pixel, thus choose the lower pixel (x k +1, y k -1) for plotting, or otherwise if P k =0, the midpoint lies on the circle boundary, so we can choose between either of upper and lower pixels and so for consistency we can choose the upper pixel, for this case. Case (i): If P k <0 midpoint is inside the circle boundary and choose the upper pixel (x k +1, y k ) i.e. y k+1 =y k and Case (ii): If P k >=0 midpoint is outside the circle boundary and choose the lower pixel (x k +1, y k -1) i.e. y k+1 =y k -1 and

6 To compute the initial decision parameter, P 0 use the following eq. The initial point (x 0,y 0 )=(0,r) Problem: Find the points on a circle on of its octants with the circle centered at (5,5) and has a radius of 8 units. Solution: Assume that the circle is centered at origin and proceed to solve. After finding the points add center (5, 5) to each point. The initial point (x 0,y 0 )=(0,8) P 0 = 1-r = 1-8=-7 (x 0,y 0 ) = (0, 8) P 0 =-7 P 1 =-7+2+1=-4 (-ve, case (i)) P 2 =-4+4+1=1 (+ve, case (ii)) P 3 = =-6 (-ve, case (i))

7 Conclusion: Midpoint circle drawing algorithm is more efficient, due to o o o Recursive nature of the algorithm No floating point calculations Accurate and simple

Computer Graphics : Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling

Computer Graphics : Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling Computer Graphics : Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling Downloaded from :www.comp.dit.ie/bmacnamee/materials/graphics/006- Contents In today s lecture we ll have a loo at:

More information

Scan Conversion. CMP 477 Computer Graphics S. A. Arekete

Scan Conversion. CMP 477 Computer Graphics S. A. Arekete Scan Conversion CMP 477 Computer Graphics S. A. Areete What is Scan-Conversion? 2D or 3D objects in real world space are made up of graphic primitives such as points, lines, circles and filled polygons.

More information

In today s lecture we ll have a look at: A simple technique The mid-point circle algorithm

In today s lecture we ll have a look at: A simple technique The mid-point circle algorithm Drawing Circles In today s lecture we ll have a look at: Circle drawing algorithms A simple technique The mid-point circle algorithm Polygon fill algorithms Summary raster drawing algorithms A Simple Circle

More information

UNIT 2 GRAPHIC PRIMITIVES

UNIT 2 GRAPHIC PRIMITIVES UNIT 2 GRAPHIC PRIMITIVES Structure Page Nos. 2.1 Introduction 46 2.2 Objectives 46 2.3 Points and Lines 46 2.4 Line Generation Algorithms 48 2.4.1 DDA Algorithm 49 2.4.2 Bresenhams Line Generation Algorithm

More information

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives.

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives. D Graphics Primitives Eye sees Displays - CRT/LCD Frame buffer - Addressable pixel array (D) Graphics processor s main function is to map application model (D) by projection on to D primitives: points,

More information

CS 450: COMPUTER GRAPHICS REVIEW: DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE

CS 450: COMPUTER GRAPHICS REVIEW: DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE CS 450: COMPUTER GRAPHICS REVIEW: DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE DRAWING PRIMITIVES: LEGACY VS. NEW Legacy: specify primitive in glbegin() glbegin(gl_points); glvertex3f(1,5,0);

More information

Chapter - 2: Geometry and Line Generations

Chapter - 2: Geometry and Line Generations Chapter - 2: Geometry and Line Generations In Computer graphics, various application ranges in different areas like entertainment to scientific image processing. In defining this all application mathematics

More information

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14 Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14 Scan Converting Lines, Circles and Ellipses Hello everybody, welcome again

More information

Computer Graphics: Graphics Output Primitives Line Drawing Algorithms

Computer Graphics: Graphics Output Primitives Line Drawing Algorithms Computer Graphics: Graphics Output Primitives Line Drawing Algorithms By: A. H. Abdul Hafez Abdul.hafez@hku.edu.tr, 1 Outlines 1. Basic concept of lines in OpenGL 2. Line Equation 3. DDA Algorithm 4. DDA

More information

Digital Differential Analyzer Bresenhams Line Drawing Algorithm

Digital Differential Analyzer Bresenhams Line Drawing Algorithm Bresenham s Line Generation The Bresenham algorithm is another incremental scan conversion algorithm. The big advantage of this algorithm is that, it uses only integer calculations. Difference Between

More information

WHAT YOU SHOULD LEARN

WHAT YOU SHOULD LEARN GRAPHS OF EQUATIONS WHAT YOU SHOULD LEARN Sketch graphs of equations. Find x- and y-intercepts of graphs of equations. Use symmetry to sketch graphs of equations. Find equations of and sketch graphs of

More information

Test Name: Chapter 3 Review

Test Name: Chapter 3 Review Test Name: Chapter 3 Review 1. For the following equation, determine the values of the missing entries. If needed, write your answer as a fraction reduced to lowest terms. 10x - 8y = 18 Note: Each column

More information

Output Primitives. Dr. S.M. Malaek. Assistant: M. Younesi

Output Primitives. Dr. S.M. Malaek. Assistant: M. Younesi Output Primitives Dr. S.M. Malaek Assistant: M. Younesi Output Primitives Output Primitives: Basic geometric structures (points, straight line segment, circles and other conic sections, quadric surfaces,

More information

Output Primitives Lecture: 4. Lecture 4

Output Primitives Lecture: 4. Lecture 4 Lecture 4 Circle Generating Algorithms Since the circle is a frequently used component in pictures and graphs, a procedure for generating either full circles or circular arcs is included in most graphics

More information

Section 1.1 The Distance and Midpoint Formulas

Section 1.1 The Distance and Midpoint Formulas Section 1.1 The Distance and Midpoint Formulas 1 y axis origin x axis 2 Plot the points: ( 3, 5), (0,7), ( 6,0), (6,4) 3 Distance Formula y x 4 Finding the Distance Between Two Points Find the distance

More information

Renderer Implementation: Basics and Clipping. Overview. Preliminaries. David Carr Virtual Environments, Fundamentals Spring 2005

Renderer Implementation: Basics and Clipping. Overview. Preliminaries. David Carr Virtual Environments, Fundamentals Spring 2005 INSTITUTIONEN FÖR SYSTEMTEKNIK LULEÅ TEKNISKA UNIVERSITET Renderer Implementation: Basics and Clipping David Carr Virtual Environments, Fundamentals Spring 2005 Feb-28-05 SMM009, Basics and Clipping 1

More information

CPSC / Scan Conversion

CPSC / Scan Conversion CPSC 599.64 / 601.64 Computer Screens: Raster Displays pixel rasters (usually) square pixels in rectangular raster evenly cover the image problem no such things such as lines, circles, etc. scan conversion

More information

CSCI 4620/8626. Coordinate Reference Frames

CSCI 4620/8626. Coordinate Reference Frames CSCI 4620/8626 Computer Graphics Graphics Output Primitives Last update: 2014-02-03 Coordinate Reference Frames To describe a picture, the world-coordinate reference frame (2D or 3D) must be selected.

More information

(Refer Slide Time: 00:03:51)

(Refer Slide Time: 00:03:51) Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 17 Scan Converting Lines, Circles and Ellipses Hello and welcome everybody

More information

Each point P in the xy-plane corresponds to an ordered pair (x, y) of real numbers called the coordinates of P.

Each point P in the xy-plane corresponds to an ordered pair (x, y) of real numbers called the coordinates of P. Lecture 7, Part I: Section 1.1 Rectangular Coordinates Rectangular or Cartesian coordinate system Pythagorean theorem Distance formula Midpoint formula Lecture 7, Part II: Section 1.2 Graph of Equations

More information

Rasterization: Geometric Primitives

Rasterization: Geometric Primitives Rasterization: Geometric Primitives Outline Rasterizing lines Rasterizing polygons 1 Rasterization: What is it? How to go from real numbers of geometric primitives vertices to integer coordinates of pixels

More information

GRAPHICS OUTPUT PRIMITIVES

GRAPHICS OUTPUT PRIMITIVES CHAPTER 3 GRAPHICS OUTPUT PRIMITIVES LINE DRAWING ALGORITHMS DDA Line Algorithm Bresenham Line Algorithm Midpoint Circle Algorithm Midpoint Ellipse Algorithm CG - Chapter-3 LINE DRAWING Line drawing is

More information

Computer Graphics D Graphics Algorithms

Computer Graphics D Graphics Algorithms ! Computer Graphics 2014! 2. 2D Graphics Algorithms Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2014-09-26! Screen Nikon D40 Sensors 3 Rasterization - The task of displaying a world modeled

More information

Output Primitives Lecture: 3. Lecture 3. Output Primitives. Assuming we have a raster display, a picture is completely specified by:

Output Primitives Lecture: 3. Lecture 3. Output Primitives. Assuming we have a raster display, a picture is completely specified by: Lecture 3 Output Primitives Assuming we have a raster display, a picture is completely specified by: - A set of intensities for the pixel positions in the display. - A set of complex objects, such as trees

More information

CS 130. Scan Conversion. Raster Graphics

CS 130. Scan Conversion. Raster Graphics CS 130 Scan Conversion Raster Graphics 2 1 Image Formation Computer graphics forms images, generally two dimensional, using processes analogous to physical imaging systems like: - Cameras - Human visual

More information

From Vertices to Fragments: Rasterization. Reading Assignment: Chapter 7. Special memory where pixel colors are stored.

From Vertices to Fragments: Rasterization. Reading Assignment: Chapter 7. Special memory where pixel colors are stored. From Vertices to Fragments: Rasterization Reading Assignment: Chapter 7 Frame Buffer Special memory where pixel colors are stored. System Bus CPU Main Memory Graphics Card -- Graphics Processing Unit (GPU)

More information

Overview of Computer Graphics

Overview of Computer Graphics Application of Computer Graphics UNIT- 1 Overview of Computer Graphics Computer-Aided Design for engineering and architectural systems etc. Objects maybe displayed in a wireframe outline form. Multi-window

More information

Line Drawing Week 6, Lecture 9

Line Drawing Week 6, Lecture 9 CS 536 Computer Graphics Line Drawing Week 6, Lecture 9 David Breen, William Regli and axim Peysakhov Department of Computer Science Drexel University Outline Line drawing Digital differential analyzer

More information

Graphs of Equations. MATH 160, Precalculus. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Graphs of Equations

Graphs of Equations. MATH 160, Precalculus. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Graphs of Equations Graphs of Equations MATH 160, Precalculus J. Robert Buchanan Department of Mathematics Fall 2011 Objectives In this lesson we will learn to: sketch the graphs of equations, find the x- and y-intercepts

More information

UNIT -8 IMPLEMENTATION

UNIT -8 IMPLEMENTATION UNIT -8 IMPLEMENTATION 1. Discuss the Bresenham s rasterization algorithm. How is it advantageous when compared to other existing methods? Describe. (Jun2012) 10M Ans: Consider drawing a line on a raster

More information

MODULE - 7. Subject: Computer Science. Module: Other 2D Transformations. Module No: CS/CGV/7

MODULE - 7. Subject: Computer Science. Module: Other 2D Transformations. Module No: CS/CGV/7 MODULE - 7 e-pg Pathshala Subject: Computer Science Paper: Computer Graphics and Visualization Module: Other 2D Transformations Module No: CS/CGV/7 Quadrant e-text Objectives: To get introduced to the

More information

1.8 Coordinate Geometry. Copyright Cengage Learning. All rights reserved.

1.8 Coordinate Geometry. Copyright Cengage Learning. All rights reserved. 1.8 Coordinate Geometry Copyright Cengage Learning. All rights reserved. Objectives The Coordinate Plane The Distance and Midpoint Formulas Graphs of Equations in Two Variables Intercepts Circles Symmetry

More information

CS6504 & Computer Graphics Unit I Page 1

CS6504 & Computer Graphics Unit I Page 1 Introduction Computer contains two components. Computer hardware Computer hardware contains the graphics workstations, graphic input devices and graphic output devices. Computer Software Computer software

More information

SE Mock Online Test 1-CG

SE Mock Online Test 1-CG SE Mock Online Test 1-CG 1. Email address * 2. 1. For gentle slope line, slope m is -1

More information

From Ver(ces to Fragments: Rasteriza(on

From Ver(ces to Fragments: Rasteriza(on From Ver(ces to Fragments: Rasteriza(on From Ver(ces to Fragments 3D vertices vertex shader rasterizer fragment shader final pixels 2D screen fragments l determine fragments to be covered l interpolate

More information

Review for Mastery Using Graphs and Tables to Solve Linear Systems

Review for Mastery Using Graphs and Tables to Solve Linear Systems 3-1 Using Graphs and Tables to Solve Linear Systems A linear system of equations is a set of two or more linear equations. To solve a linear system, find all the ordered pairs (x, y) that make both equations

More information

MODULE - 9. Subject: Computer Science. Module: Line Clipping. Module No: CS/CGV/9

MODULE - 9. Subject: Computer Science. Module: Line Clipping. Module No: CS/CGV/9 Quadrant 1 e-text e-pg Pathshala MODULE - 9 Subject: Computer Science Paper: Computer Graphics and Visualization Module: Line Clipping Module No: CS/CGV/9 Objectives: Understand Cohen-Sutherland Line Clipping

More information

SNAP Centre Workshop. Graphing Lines

SNAP Centre Workshop. Graphing Lines SNAP Centre Workshop Graphing Lines 45 Graphing a Line Using Test Values A simple way to linear equation involves finding test values, plotting the points on a coordinate plane, and connecting the points.

More information

Tópicos de Computação Gráfica Topics in Computer Graphics 10509: Doutoramento em Engenharia Informática. Chap. 2 Rasterization.

Tópicos de Computação Gráfica Topics in Computer Graphics 10509: Doutoramento em Engenharia Informática. Chap. 2 Rasterization. Tópicos de Computação Gráfica Topics in Computer Graphics 10509: Doutoramento em Engenharia Informática Chap. 2 Rasterization Rasterization Outline : Raster display technology. Basic concepts: pixel, resolution,

More information

Unit 2 Output Primitives and their Attributes

Unit 2 Output Primitives and their Attributes Unit 2 Output Primitives and their Attributes Shapes and colors of the objects can be described internally with pixel arrays or with sets of basic geometric structures, such as straight line segments and

More information

Chapter 8: Implementation- Clipping and Rasterization

Chapter 8: Implementation- Clipping and Rasterization Chapter 8: Implementation- Clipping and Rasterization Clipping Fundamentals Cohen-Sutherland Parametric Polygons Circles and Curves Text Basic Concepts: The purpose of clipping is to remove objects or

More information

Line Drawing. Introduction to Computer Graphics Torsten Möller / Mike Phillips. Machiraju/Zhang/Möller

Line Drawing. Introduction to Computer Graphics Torsten Möller / Mike Phillips. Machiraju/Zhang/Möller Line Drawing Introduction to Computer Graphics Torsten Möller / Mike Phillips Rendering Pipeline Hardware Modelling Transform Visibility Illumination + Shading Perception, Color Interaction Texture/ Realism

More information

Graphics (Output) Primitives. Chapters 3 & 4

Graphics (Output) Primitives. Chapters 3 & 4 Graphics (Output) Primitives Chapters 3 & 4 Graphic Output and Input Pipeline Scan conversion converts primitives such as lines, circles, etc. into pixel values geometric description a finite scene area

More information

RASTERIZING POLYGONS IN IMAGE SPACE

RASTERIZING POLYGONS IN IMAGE SPACE On-Line Computer Graphics Notes RASTERIZING POLYGONS IN IMAGE SPACE Kenneth I. Joy Visualization and Graphics Research Group Department of Computer Science University of California, Davis A fundamental

More information

CS 4731: Computer Graphics Lecture 21: Raster Graphics: Drawing Lines. Emmanuel Agu

CS 4731: Computer Graphics Lecture 21: Raster Graphics: Drawing Lines. Emmanuel Agu CS 4731: Computer Graphics Lecture 21: Raster Graphics: Drawing Lines Emmanuel Agu 2D Graphics Pipeline Clipping Object World Coordinates Applying world window Object subset window to viewport mapping

More information

Lecture 5. If, as shown in figure, we form a right triangle With P1 and P2 as vertices, then length of the horizontal

Lecture 5. If, as shown in figure, we form a right triangle With P1 and P2 as vertices, then length of the horizontal Distance; Circles; Equations of the form Lecture 5 y = ax + bx + c In this lecture we shall derive a formula for the distance between two points in a coordinate plane, and we shall use that formula to

More information

Points and lines. x x 1 + y 1. y = mx + b

Points and lines. x x 1 + y 1. y = mx + b Points and lines Point is the fundamental element of the picture representation. It is nothing but the position in a plan defined as either pairs or triplets of number depending on whether the data are

More information

Einführung in Visual Computing

Einführung in Visual Computing Einführung in Visual Computing 186.822 Rasterization Werner Purgathofer Rasterization in the Rendering Pipeline scene objects in object space transformed vertices in clip space scene in normalized device

More information

Computer Graphics D Graphics Algorithms

Computer Graphics D Graphics Algorithms Computer Graphics 2015 2. 2D Graphics Algorithms Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2015-09-21 Screen - Linear Structure Nikon D40 Sensors 3 RGBW Camera Sensor RGBW Camera Sensor

More information

Chapter 3. Sukhwinder Singh

Chapter 3. Sukhwinder Singh Chapter 3 Sukhwinder Singh PIXEL ADDRESSING AND OBJECT GEOMETRY Object descriptions are given in a world reference frame, chosen to suit a particular application, and input world coordinates are ultimately

More information

Line Drawing. Foundations of Computer Graphics Torsten Möller

Line Drawing. Foundations of Computer Graphics Torsten Möller Line Drawing Foundations of Computer Graphics Torsten Möller Rendering Pipeline Hardware Modelling Transform Visibility Illumination + Shading Perception, Interaction Color Texture/ Realism Reading Angel

More information

Section 18-1: Graphical Representation of Linear Equations and Functions

Section 18-1: Graphical Representation of Linear Equations and Functions Section 18-1: Graphical Representation of Linear Equations and Functions Prepare a table of solutions and locate the solutions on a coordinate system: f(x) = 2x 5 Learning Outcome 2 Write x + 3 = 5 as

More information

Chapter 1. Linear Equations and Straight Lines. 2 of 71. Copyright 2014, 2010, 2007 Pearson Education, Inc.

Chapter 1. Linear Equations and Straight Lines. 2 of 71. Copyright 2014, 2010, 2007 Pearson Education, Inc. Chapter 1 Linear Equations and Straight Lines 2 of 71 Outline 1.1 Coordinate Systems and Graphs 1.4 The Slope of a Straight Line 1.3 The Intersection Point of a Pair of Lines 1.2 Linear Inequalities 1.5

More information

CS-321 Thursday 12 September 2002 Quiz (3 pts.) What is the purpose of a control grid in a cathode ray tube (CRT)?

CS-321 Thursday 12 September 2002 Quiz (3 pts.) What is the purpose of a control grid in a cathode ray tube (CRT)? Name CS-321 Thursday 12 September 2002 Quiz 1 1. (3 pts.) What is the purpose of a control grid in a cathode ray tube (CRT)? 2. (7 pts.) For the same resolution in pixels (for example, 640x480), why does

More information

1 Introduction to Graphics

1 Introduction to Graphics 1 1.1 Raster Displays The screen is represented by a 2D array of locations called pixels. Zooming in on an image made up of pixels The convention in these notes will follow that of OpenGL, placing the

More information

WK # Given: f(x) = ax2 + bx + c

WK # Given: f(x) = ax2 + bx + c Alg2H Chapter 5 Review 1. Given: f(x) = ax2 + bx + c Date or y = ax2 + bx + c Related Formulas: y-intercept: ( 0, ) Equation of Axis of Symmetry: x = Vertex: (x,y) = (, ) Discriminant = x-intercepts: When

More information

Efficient Plotting Algorithm

Efficient Plotting Algorithm Efficient Plotting Algorithm Sushant Ipte 1, Riddhi Agarwal 1, Murtuza Barodawala 1, Ravindra Gupta 1, Prof. Shiburaj Pappu 1 Computer Department, Rizvi College of Engineering, Mumbai, Maharashtra, India

More information

Announcements. Midterms graded back at the end of class Help session on Assignment 3 for last ~20 minutes of class. Computer Graphics

Announcements. Midterms graded back at the end of class Help session on Assignment 3 for last ~20 minutes of class. Computer Graphics Announcements Midterms graded back at the end of class Help session on Assignment 3 for last ~20 minutes of class 1 Scan Conversion Overview of Rendering Scan Conversion Drawing Lines Drawing Polygons

More information

Chapter 3A Rectangular Coordinate System

Chapter 3A Rectangular Coordinate System Fry Texas A&M University! Math 150! Spring 2015!!! Unit 4!!! 1 Chapter 3A Rectangular Coordinate System A is any set of ordered pairs of real numbers. The of the relation is the set of all first elements

More information

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Computer Graphics

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Computer Graphics r About the Tutorial To display a picture of any size on a computer screen is a difficult process. Computer graphics are used to simplify this process. Various algorithms and techniques are used to generate

More information

Rasterization, or What is glbegin(gl_lines) really doing?

Rasterization, or What is glbegin(gl_lines) really doing? Rasterization, or What is glbegin(gl_lines) really doing? Course web page: http://goo.gl/eb3aa February 23, 2012 Lecture 4 Outline Rasterizing lines DDA/parametric algorithm Midpoint/Bresenham s algorithm

More information

Lab Manual. Computer Graphics. T.E. Computer. (Sem VI)

Lab Manual. Computer Graphics. T.E. Computer. (Sem VI) Lab Manual Computer Graphics T.E. Computer (Sem VI) Index Sr. No. Title of Programming Assignments Page No. 1. Line Drawing Algorithms 3 2. Circle Drawing Algorithms 6 3. Ellipse Drawing Algorithms 8 4.

More information

A is any set of ordered pairs of real numbers. This is a set of ordered pairs of real numbers, so it is a.

A is any set of ordered pairs of real numbers. This is a set of ordered pairs of real numbers, so it is a. Fry Texas A&M University!! Math 150!! Chapter 3!! Fall 2014! 1 Chapter 3A Rectangular Coordinate System A is any set of ordered pairs of real numbers. A relation can be finite: {(-3, 1), (-3, -1), (0,

More information

Section Graphs and Lines

Section Graphs and Lines Section 1.1 - Graphs and Lines The first chapter of this text is a review of College Algebra skills that you will need as you move through the course. This is a review, so you should have some familiarity

More information

Topic #1: Rasterization (Scan Conversion)

Topic #1: Rasterization (Scan Conversion) Topic #1: Rasterization (Scan Conversion) We will generally model objects with geometric primitives points, lines, and polygons For display, we need to convert them to pixels for points it s obvious but

More information

1 Some easy lines (2, 17) (10, 17) (18, 2) (18, 14) (1, 5) (8, 12) Check with a ruler. Are your lines straight?

1 Some easy lines (2, 17) (10, 17) (18, 2) (18, 14) (1, 5) (8, 12) Check with a ruler. Are your lines straight? 1 Some easy lines Computers draw images using pixels. Pixels are the tiny squares that make up the image you see on computer monitors. If you look carefully at a computer screen with a magnifying glass,

More information

A New Line Drawing Algorithm Based on Sample Rate Conversion

A New Line Drawing Algorithm Based on Sample Rate Conversion A New Line Drawing Algorithm Based on Sample Rate Conversion c 2002, C. Bond. All rights reserved. February 5, 2002 1 Overview In this paper, a new method for drawing straight lines suitable for use on

More information

Solution Notes. COMP 151: Terms Test

Solution Notes. COMP 151: Terms Test Family Name:.............................. Other Names:............................. ID Number:............................... Signature.................................. Solution Notes COMP 151: Terms

More information

Scan Converting Circles

Scan Converting Circles Scan Conversion Algorithms CS 460 Computer Graphics Professor Richard Eckert Circles Ellipses and Other 2-D Curves Text February 16, 2004 Scan Converting Circles Given: Center: (h,k) Radius: r Equation:

More information

We have already studied equations of the line. There are several forms:

We have already studied equations of the line. There are several forms: Chapter 13-Coordinate Geometry extended. 13.1 Graphing equations We have already studied equations of the line. There are several forms: slope-intercept y = mx + b point-slope y - y1=m(x - x1) standard

More information

notes13.1inclass May 01, 2015

notes13.1inclass May 01, 2015 Chapter 13-Coordinate Geometry extended. 13.1 Graphing equations We have already studied equations of the line. There are several forms: slope-intercept y = mx + b point-slope y - y1=m(x - x1) standard

More information

I Internal Examination (Model Paper) B.Tech III Year VI semester, Computer Science & Engineering

I Internal Examination (Model Paper) B.Tech III Year VI semester, Computer Science & Engineering I Internal Examination 2017-18 (Model Paper) B.Tech III Year VI semester, Computer Science & Engineering Subject: 6CS4 Computer Graphics & Multimedia Technology Time: 1:30 Hr M.M:40 Question No. Question

More information

Chapter 3: Graphics Output Primitives. OpenGL Line Functions. OpenGL Point Functions. Line Drawing Algorithms

Chapter 3: Graphics Output Primitives. OpenGL Line Functions. OpenGL Point Functions. Line Drawing Algorithms Chater : Grahics Outut Primitives Primitives: functions in grahics acage that we use to describe icture element Points and straight lines are the simlest rimitives Some acages include circles, conic sections,

More information

Module 4. Stereographic projection: concept and application. Lecture 4. Stereographic projection: concept and application

Module 4. Stereographic projection: concept and application. Lecture 4. Stereographic projection: concept and application Module 4 Stereographic projection: concept and application Lecture 4 Stereographic projection: concept and application 1 NPTEL Phase II : IIT Kharagpur : Prof. R. N. Ghosh, Dept of Metallurgical and Materials

More information

Rendering. A simple X program to illustrate rendering

Rendering. A simple X program to illustrate rendering Rendering A simple X program to illustrate rendering The programs in this directory provide a simple x based application for us to develop some graphics routines. Please notice the following: All points

More information

0. Introduction: What is Computer Graphics? 1. Basics of scan conversion (line drawing) 2. Representing 2D curves

0. Introduction: What is Computer Graphics? 1. Basics of scan conversion (line drawing) 2. Representing 2D curves CSC 418/2504: Computer Graphics Course web site (includes course information sheet): http://www.dgp.toronto.edu/~elf Instructor: Eugene Fiume Office: BA 5266 Phone: 416 978 5472 (not a reliable way) Email:

More information

State the domain and range of the relation. EX: {(-1,1), (1,5), (0,3)} 1 P a g e Province Mathematics Southwest TN Community College

State the domain and range of the relation. EX: {(-1,1), (1,5), (0,3)} 1 P a g e Province Mathematics Southwest TN Community College A relation is a set of ordered pairs of real numbers. The domain, D, of a relation is the set of all first coordinates of the ordered pairs in the relation (the xs). The range, R, of a relation is the

More information

We have already studied equations of the line. There are several forms:

We have already studied equations of the line. There are several forms: Chapter 13-Coordinate Geometry extended. 13.1 Graphing equations We have already studied equations of the line. There are several forms: slope-intercept y = mx + b point-slope y - y1=m(x - x1) standard

More information

CS 450: COMPUTER GRAPHICS RASTERIZING LINES SPRING 2016 DR. MICHAEL J. REALE

CS 450: COMPUTER GRAPHICS RASTERIZING LINES SPRING 2016 DR. MICHAEL J. REALE CS 45: COMPUTER GRAPHICS RASTERIZING LINES SPRING 6 DR. MICHAEL J. REALE OBJECT-ORDER RENDERING We going to start on how we will perform object-order rendering Object-order rendering Go through each OBJECT

More information

Math 8 Honors Coordinate Geometry part 3 Unit Updated July 29, 2016

Math 8 Honors Coordinate Geometry part 3 Unit Updated July 29, 2016 Review how to find the distance between two points To find the distance between two points, use the Pythagorean theorem. The difference between is one leg and the difference between and is the other leg.

More information

EFFICIENT INTEGER ALGORITHMS FOR THE GENERATION OF CONIC SECTIONS

EFFICIENT INTEGER ALGORITHMS FOR THE GENERATION OF CONIC SECTIONS Comput. & Graphics, Vol. 22, No. 5, pp. 621±628, 1998 # 1998 Elsevier Science Ltd. All rights reserved PII: S0097-8493(98)00069-7 Printed in Great Britain 0097-8493/98/$ - see front matter EFFICIENT INTEGER

More information

4. TANGENTS AND NORMALS

4. TANGENTS AND NORMALS 4. TANGENTS AND NORMALS 4. Equation of the Tangent at a Point Recall that the slope of a curve at a point is the slope of the tangent at that point. The slope of the tangent is the value of the derivative

More information

9.1 Parametric Curves

9.1 Parametric Curves Math 172 Chapter 9A notes Page 1 of 20 9.1 Parametric Curves So far we have discussed equations in the form. Sometimes and are given as functions of a parameter. Example. Projectile Motion Sketch and axes,

More information

A function: A mathematical relationship between two variables (x and y), where every input value (usually x) has one output value (usually y)

A function: A mathematical relationship between two variables (x and y), where every input value (usually x) has one output value (usually y) SESSION 9: FUNCTIONS KEY CONCEPTS: Definitions & Terminology Graphs of Functions - Straight line - Parabola - Hyperbola - Exponential Sketching graphs Finding Equations Combinations of graphs TERMINOLOGY

More information

Computer Graphics Lecture Notes

Computer Graphics Lecture Notes Computer Graphics Lecture Notes UNIT- Overview of Computer Graphics. Application of Computer Graphics Computer-Aided Design for engineering and architectural systems etc. Objects maybe displayed in a wireframe

More information

MET71 COMPUTER AIDED DESIGN

MET71 COMPUTER AIDED DESIGN UNIT - II BRESENHAM S ALGORITHM BRESENHAM S LINE ALGORITHM Bresenham s algorithm enables the selection of optimum raster locations to represent a straight line. In this algorithm either pixels along X

More information

6.7. POLAR COORDINATES

6.7. POLAR COORDINATES 6.7. POLAR COORDINATES What You Should Learn Plot points on the polar coordinate system. Convert points from rectangular to polar form and vice versa. Convert equations from rectangular to polar form and

More information

CSC Computer Graphics

CSC Computer Graphics 7//7 CSC. Computer Graphics Lecture Kasun@dscs.sjp.ac.l Department of Computer Science Universit of Sri Jaewardanepura Line drawing algorithms DDA Midpoint (Bresenham s) Algorithm Circle drawing algorithms

More information

Scan Conversion. Lines and Circles

Scan Conversion. Lines and Circles Scan Conversion Lines and Circles (Chapter 3 in Foley & Van Dam) 2D Line Implicit representation: αx + βy + γ = 0 Explicit representation: y y = mx+ B m= x Parametric representation: x P= y P = t y P +

More information

Painter s HSR Algorithm

Painter s HSR Algorithm Painter s HSR Algorithm Render polygons farthest to nearest Similar to painter layers oil paint Viewer sees B behind A Render B then A Depth Sort Requires sorting polygons (based on depth) O(n log n) complexity

More information

An Improved Algorithm for Scan-converting a Line

An Improved Algorithm for Scan-converting a Line An Improved Algorithm for Scan-converting a Line *Md. Hasanul Kabir 1, Md. Imrul Hassan 2, Abdullah Azfar 1 1 Department of Computer Science & Information Technology (CIT) 2 Department of Electrical &

More information

Example 1: Give the coordinates of the points on the graph.

Example 1: Give the coordinates of the points on the graph. Ordered Pairs Often, to get an idea of the behavior of an equation, we will make a picture that represents the solutions to the equation. A graph gives us that picture. The rectangular coordinate plane,

More information

Raster Scan Displays. Framebuffer (Black and White)

Raster Scan Displays. Framebuffer (Black and White) Raster Scan Displays Beam of electrons deflected onto a phosphor coated screen Phosphors emit light when excited by the electrons Phosphor brightness decays -- need to refresh the display Phosphors make

More information

Scan Conversion. Drawing Lines Drawing Circles

Scan Conversion. Drawing Lines Drawing Circles Scan Conversion Drawing Lines Drawing Circles 1 How to Draw This? 2 Start From Simple How to draw a line: y(x) = mx + b? 3 Scan Conversion, a.k.a. Rasterization Ideal Picture Raster Representation Scan

More information

Investigating the Sine and Cosine Functions Part 1

Investigating the Sine and Cosine Functions Part 1 Investigating the Sine and Cosine Functions Part 1 Name: Period: Date: Set-Up Press. Move down to 5: Cabri Jr and press. Press for the F1 menu and select New. Press for F5 and select Hide/Show > Axes.

More information

CS Rasterization. Junqiao Zhao 赵君峤

CS Rasterization. Junqiao Zhao 赵君峤 CS10101001 Rasterization Junqiao Zhao 赵君峤 Department of Computer Science and Technology College of Electronics and Information Engineering Tongji University Vector Graphics Algebraic equations describe

More information

Computer Graphics. Lecture 2. Doç. Dr. Mehmet Gokturk

Computer Graphics. Lecture 2. Doç. Dr. Mehmet Gokturk Computer Graphics Lecture 2 Doç. Dr. Mehmet Gokturk Mathematical Foundations l Hearn and Baker (A1 A4) appendix gives good review l Some of the mathematical tools l Trigonometry l Vector spaces l Points,

More information

Computer Graphics: 8-Hidden Surface Removal

Computer Graphics: 8-Hidden Surface Removal Computer Graphics: 8-Hidden Surface Removal Prof. Dr. Charles A. Wüthrich, Fakultät Medien, Medieninformatik Bauhaus-Universität Weimar caw AT medien.uni-weimar.de Depth information Depth information is

More information

L13-Mon-3-Oct-2016-Sec-1-1-Dist-Midpt-HW Graph-HW12-Moodle-Q11, page 1 L13-Mon-3-Oct-2016-Sec-1-1-Dist-Midpt-HW Graph-HW12-Moodle-Q11

L13-Mon-3-Oct-2016-Sec-1-1-Dist-Midpt-HW Graph-HW12-Moodle-Q11, page 1 L13-Mon-3-Oct-2016-Sec-1-1-Dist-Midpt-HW Graph-HW12-Moodle-Q11 L13-Mon-3-Oct-016-Sec-1-1-Dist-Midpt-HW11-1--Graph-HW1-Moodle-Q11, page 1 L13-Mon-3-Oct-016-Sec-1-1-Dist-Midpt-HW11-1--Graph-HW1-Moodle-Q11 1.1 Rectangular Coordinate System: Suppose we know the sum of

More information

Rational Numbers on the Coordinate Plane. 6.NS.C.6c

Rational Numbers on the Coordinate Plane. 6.NS.C.6c Rational Numbers on the Coordinate Plane 6.NS.C.6c Copy all slides into your composition notebook. Lesson 14 Ordered Pairs Objective: I can use ordered pairs to locate points on the coordinate plane. Guiding

More information