B. TECH. VI SEM. I MID TERM EXAMINATION 2018

Similar documents
Types of CRT Display Devices. DVST-Direct View Storage Tube

Part 1: Introduction to Computer Graphics

2.2. VIDEO DISPLAY DEVICES

Computer Graphics: Overview of Graphics Systems

Display Technologies CMSC 435. Slides based on Dr. Luebke s slides

CATHODE-RAY OSCILLOSCOPE (CRO)

Comp 410/510. Computer Graphics Spring Introduction to Graphics Systems

These are used for producing a narrow and sharply focus beam of electrons.

Display Systems. Viewing Images Rochester Institute of Technology

Computer Graphics : Unit - I

CMPE 466 COMPUTER GRAPHICS

Part 1: Introduction to computer graphics 1. Describe Each of the following: a. Computer Graphics. b. Computer Graphics API. c. CG s can be used in

CHAPTER 3 OSCILLOSCOPES AND SIGNAL GENERATOR

CS2401-COMPUTER GRAPHICS QUESTION BANK

Computer Graphics Hardware

CHAPTER 4 OSCILLOSCOPES

THE OPERATION OF A CATHODE RAY TUBE

The Cathode Ray Tube

CATHODE RAY OSCILLOSCOPE. Basic block diagrams Principle of operation Measurement of voltage, current and frequency

PTIK UNNES. Lecture 02. Conceptual Model for Computer Graphics and Graphics Hardware Issues

CATHODE RAY OSCILLOSCOPE (CRO)

Sep 09, APPLICATION NOTE 1193 Electronic Displays Comparison

THE OPERATION OF A CATHODE RAY TUBE

MODULE I MCA COMPUTER GRAPHICS ADMN APPLICATIONS OF COMPUTER GRAPHICS

Display Devices & its Interfacing

L14 - Video. L14: Spring 2005 Introductory Digital Systems Laboratory

Reading. Display Devices. Light Gathering. The human retina

Electrical & Electronic Measurements: Class Notes (15EE36) Module-5. Display Devices

OSCILLOSCOPE AND DIGITAL MULTIMETER

1. Introduction. 1.1 Graphics Areas. Modeling: building specification of shape and appearance properties that can be stored in computer

Screens; media that use additive primaries

Monitor and Display Adapters UNIT 4

decodes it along with the normal intensity signal, to determine how to modulate the three colour beams.

Displays. History. Cathode ray tubes (CRTs) Modern graphics systems. CSE 457, Autumn 2003 Graphics. » Whirlwind Computer - MIT, 1950

3. Displays and framebuffers

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 5 CRT Display Devices

Elements of a Television System

VARIOUS DISPLAY TECHNOLOGIESS

Reading. Displays and framebuffers. Modern graphics systems. History. Required. Angel, section 1.2, chapter 2 through 2.5. Related

Downloads from:

Reading. 1. Displays and framebuffers. History. Modern graphics systems. Required

Basically we are fooling our brains into seeing still images at a fast enough rate so that we think its a moving image.

1 Your computer screen

Objectives: Topics covered: Basic terminology Important Definitions Display Processor Raster and Vector Graphics Coordinate Systems Graphics Standards

Introduction to Computer Graphics

Tutorial Cathode Rays Year 12 Physics - Module 9.3 Motors and Generators

Lecture Flat Panel Display Devices

A Review- on Different Types of Displays

Introduction & Colour

2.4.1 Graphics. Graphics Principles: Example Screen Format IMAGE REPRESNTATION

INSTRUMENT CATHODE-RAY TUBE

Lecture Flat Panel Display Devices

RICHLAND COLLEGE School of Engineering Business & Technology Rev. 0 W. Slonecker Rev. 1 (8/26/2012) J. Bradbury

DISPLAY TECHNOLOGIES. Group 6: Steve Lenhart, Ryan King, Ramsey Akl, and Andrew Scheib

INSTRUMENT CATHODE-RAY TUBE

J.J. Thomson, Cathode Rays and the Electron

Technology White Paper Plasma Displays. NEC Technologies Visual Systems Division

Television brian egan isnm 2004

Computer Graphics. Raster Scan Display System, Rasterization, Refresh Rate, Video Basics and Scan Conversion

Teltron Delection Tube D

UNIT 1 INTRODUCTION TO COMPUTER

Presented by: Amany Mohamed Yara Naguib May Mohamed Sara Mahmoud Maha Ali. Supervised by: Dr.Mohamed Abd El Ghany

An Efficient SOC approach to Design CRT controller on CPLD s

Computer Graphics. Introduction

High-resolution screens have become a mainstay on modern smartphones. Initial. Displays 3.1 LCD

CR7000. CRT Analyzer & Restorer. Easily Test And Restore CRTs With The Most Complete Tests Available For Added Profit And Security.

K Service Source. Apple High-Res Monochrome Monitor

General Items: Reading Materials: Miscellaneous: Lecture 8 / Chapter 6 COSC1300/ITSC 1401/BCIS /19/2004. Tests? Questions? Anything?

Electrical and Electronic Laboratory Faculty of Engineering Chulalongkorn University. Cathode-Ray Oscilloscope (CRO)

Overview of Graphics Systems

This work was supported by FINEP (Research and Projects Financing) under contract

FUNDAMENTAL CONSTRUCTION OF A CRT

Module 7. Video and Purchasing Components

Chapter 3. Display Devices and Interfacing

K Service Source. Apple High-Res Monochrome Monitor

Design of VGA Controller using VHDL for LCD Display using FPGA

CS 4451A: Computer Graphics. Why Computer Graphics?

Understanding Multimedia - Basics

The Knowledge Bank at The Ohio State University. Ohio State Engineer

VGA Port. Chapter 5. Pin 5 Pin 10. Pin 1. Pin 6. Pin 11. Pin 15. DB15 VGA Connector (front view) DB15 Connector. Red (R12) Green (T12) Blue (R11)

INSTALATION PROCEDURE

Light Emitting Diodes (LEDs)

PAST EXAM PAPER & MEMO N3 ABOUT THE QUESTION PAPERS:

Brown, A., Merkert, J., & Wilson, R. (2014). Build your own particle accelerator. Science in School, (30),

MODIFYING A SMALL 12V OPEN FRAME INDUSTRIAL VIDEO MONITOR TO BECOME A 525/625 & 405 LINE MULTI - STANDARD MAINS POWERED UNIT. H. Holden. (Dec.

3B SCIENTIFIC PHYSICS

CHAPTER 9. Actives Devices: Diodes, Transistors,Tubes

Introduction. Edge Enhancement (SEE( Advantages of Scalable SEE) Lijun Yin. Scalable Enhancement and Optimization. Case Study:

THE CAPABILITY to display a large number of gray

Using an oscilloscope - The Hameg 203-6

Start with some basics: display devices

Flat Panel Displays: 1. Introduction

Secrets of the Studio. TELEVISION CAMERAS Technology and Practise Part 1 Chris Phillips

Duke University. Plasma Display Panel. A vanished technique

28 North Lotts, Dublin 1, Ireland Tel: info [AT] phonevolts.com

Video Display Unit (VDU)

Liquid Crystal Display (LCD)

University of Utah Electrical & Computer Engineering Department ECE1050/1060 Oscilloscope

Correlation to the Common Core State Standards

Video coding standards

Transcription:

B. TECH. VI SEM. I MID TERM EXAMINATION 2018 BRANCH : COMPUTER SCIENCE ENGINEERING ( CSE ) SUBJECT : 6CS4A COMPUTER GRAPHICS & MULTIMEDIA TECHNIQUES Q 1. Write down mid point ellipse drawing algorithm. Also give proper explanation how to calculate points of each quadrant.

OR Q 1. Write down midpoint circle drawing algorithm. Also give proper explanation how to calculate points of each octants. Ans. We need to plot the perimeter points of a circle whose center co-ordinates and radius are given using the Mid-Point Circle Drawing Algorithm. We use the above algorithm to calculate all the perimeter points of the circle in the first octant and then print them along with their mirror points in the other octants. This will work only because a circle is symmetric about it s centre. The algorithm is very similar to the Mid-Point Line Generation Algorithm. Here, only the boundary condition is different. For any given pixel (x, y), the next pixel to be plotted is either (x, y+1) or (x-1, y+1). This can be decided by following the steps below. 1. Find the mid-point p of the two possible pixels i.e (x-0.5, y+1) 2. If p lies inside or on the circle perimeter, we plot the pixel (x, y+1), otherwise if it s outside we plot the pixel (x-1, y+1) Boundary Condition : Whether the mid-point lies inside or outside the circle can be decided by using the formula:- Given a circle centered at (0,0) and radius r and a point p(x,y) F(p) = x 2 + y 2 r 2 if F(p)<0, the point is inside the circle F(p)=0, the point is on the perimeter

F(p)>0, the point is outside the circle In our program we denote F(p) with P. The value of P is calculated at the mid-point of the two contending pixels i.e. (x-0.5, y+1). Each pixel is described with a subscript k. P k = (X k 0.5) 2 + (y k + 1) 2 r 2 Now, x k+1 = x k or x k-1, y k+1 = y k +1 P k+1 = (x k+1 0.5) 2 + (y k+1 +1) 2 r 2 = (x k+1 0.5) 2 + [(y k +1) + 1] 2 r 2 = (x k+1 0.5) 2 + (y k +1) 2 + 2(y k + 1) + 1 r 2 = (x k+1 0.5) 2 + [ (x k 0.5) 2 +(x k 0.5) 2 ] + (y k + 1) 2 r 2 + (y k + 1) + 1 = P k + (x k+1 0.5) 2 (x k 0.5) 2 + 2(y k + 1) + 1 = P k + (x 2 k+1 x2 k ) 2 + (x k+1 x k ) 2 + 2(y k + 1) + 1 = P k + 2(y k +1) + 1, when P k <=0 i.e the midpoint is inside the circle (x k+1 = x k ) P k + 2(y k +1) 2(x k 1) + 1, when P k >0 I.e the mid point is outside the circle(x k+1 = x k -1) The first point to be plotted is (r, 0) on the x-axis. The initial value of P is calculated as follows:- P1 = (r 0.5) 2 + (0+1) 2 r 2 = 1.25 r = 1 -r (When rounded off) Examples: Input : Centre -> (0, 0), Radius -> 3 Output : (3, 0) (3, 0) (0, 3) (0, 3) (3, 1) (-3, 1) (3, -1) (-3, -1) (1, 3) (-1, 3) (1, -3) (-1, -3) (2, 2) (-2, 2) (2, -2) (-2, -2)

Q 2. Write down the DDA line drawing algorithm with proper explanation. Ans. In any 2-Dimensional plane if we connect two points (x0, y0) and (x1, y1), we get a line segment. But in the case of computer graphics we can not directly join any two coordinate points, for that we should calculate intermediate point s coordinate and put a pixel for each intermediate point, of the desired color with help of functions like putpixel(x, y, K) in C, where (x,y) is our co-ordinate and K denotes some color. Examples: Input: For line segment between (2, 2) and (6, 6) : we need (3, 3) (4, 4) and (5, 5) as our intermediate points. Input: For line segment between (0, 2) and (0, 6) : we need (0, 3) (0, 4) and (0, 5) as our intermediate points. For using graphics functions, our system output screen is treated as a coordinate system where the coordinate of the top-left corner is (0, 0) and as we move down our x-ordinate increases and as we move right our y-ordinate increases for any point (x, y). Now, for generating any line segment we need intermediate points and for calculating them we have can use a basic algorithm called DDA(Digital differential analyzer) line generating algorithm. DDA Algorithm: Consider one point of the line as (X0,Y0) and the second point of the line as (X1,Y1). // calculate dx, dy dx = X1 - X0; dy = Y1 - Y0; // Depending upon absolute value of dx & dy // choose number of steps to put pixel as // steps = abs(dx) > abs(dy)? abs(dx) : abs(dy) steps = abs(dx) > abs(dy)? abs(dx0 : abs(dy); // calculate increment in x & y for each steps Xinc = dx / (float) steps; Yinc = dy / (float) steps; // Put pixel for each step X = X0; Y = Y0; for (int i = 0; i <= steps; i++)

{ } putpixel (X,Y,WHITE); X += Xinc; Y += Yinc;

OR Q 2. Describe the design and working of CRT with proper diagrams. Ans. Computer technology is going to see major advances in sophisticated 3 dimensional modeling and image processing; the users will see desktop computers with the computational power of today s super-computers. Even graphics capabilities would be available to the average user at a reasonable cost. To make this, an ultra high resolution monitors will be required. There are different display systems like cathode ray tubes (CRTs), liquid crystal displays (LCDs), electroluminescent displays (ELDs), plasma displays and light emitting diodes (LEDs) are available in the present technology. Here we are going to discuss about the Cathode Ray Tube (CRT). Principle of Working age When the two metal plates are connected to a high voltage source, the negatively charged plate called cathode, emits an invisible ray. The cathode ray is drawn to the positively charged plate, called the anode, where it passes through a hole and continues travelling to the other end of the tube. When the ray strikes the specially coated surface, the cathode ray produces a strong fluorescence, or bright light. When an electric field is applied across the cathode ray tube, the cathode ray is attracted by the plate bearing positive charges. Therefore a cathode ray must consist of negatively charged particles. A moving charged body behaves like a tiny magnet, and it can interact with an external magnetic field. The electrons deflected by the magnetic field. And also when the external magnetic field is reversed, the beam of electronics is deflected in the opposite direction. In a cathode ray tube, the cathode is a heated filament and it placed in vacuum. The ray is a stream of electrons that naturally pour off a heated cathode into the vacuum. Electrons are negative. The anode is positive, so it attracts the electrons pouring off the cathode. In a TV s cathode ray tube, the stream of electrons is focused by a focusing anode into a tight beam and then accelerated by an accelerating anode. This tight, high-speed beam of electrons flies through the vacuum in the tube and hits the flat screen at the other end of the tube. This screen is coated with phosphor, which glows when struck by the beam. Operation of CRT Cathode Ray Tube (CRT) is a computer display screen, used to display the output in a standard composite video signal. The working of CRT depends on movement of an electron beam which moves back and forth across the back of the screen. The source of the electron beam is the electron gun; the gun is located in the narrow, cylindrical neck at the extreme rear of a CRT which produces a stream of electrons through thermionic emission. Usually, A CRT has a fluorescent screen to display the output signal. A simple CRT is shown in below.

Cathode Ray Tube The operation of a CRT monitor is basically very simple. A cathode ray tube consists of one or more electron guns, possibly internal electrostatic deflection plates and a phosphor target. CRT has three electron beams one for each (Red, Green, and Blue) is clearly shown in figure. The electron beam produces a tiny, bright visible spot when it strikes the phosphor-coated screen. In every monitor device the entire front area of the tube is scanned repetitively and systematically in a fixed pattern called a raster. An image (raster) is displayed by scanning the electron beam across the screen. The phosphor s targets are begins to fade after a short time, the image needs to be refreshed continuously. Thus CRT produces the three color images which are primary colors. Here we used a 50 Hz rate to eliminate the flicker by refreshing the screen. Main parts of the cathode ray tube are cathode, control grid, deflecting plates and screen. Cathode The heater keeps the cathode at a higher temperature and electrons flow from the heated cathode towards the surface of the cathode. The accelerating anode has a small hole at its center and is maintained at a high potential, which is of positive polarity. The order of this voltage is 1 to 20 kv, relative to the cathode. This potential difference creates an electric field directed from right to left in the region between the accelerating anode and the cathode. Electrons pass through the hole in the anode travel with constant horizontal velocity from the anode to the fluorescent screen. The electrons strike the screen area and it glows brightly. The Control Grid The control grid regulates the brightness of the spot on the screen. By controlling the number of electrons by the anode and hence the focusing anode ensures that electrons leaving the cathode in slightly different directions are focused down to a narrow beam and all arrive at the same spot on the screen. The whole assembly of cathode, control grid, focusing anode, and accelerating electrode is called the electron gun. Deflecting Plates Two pairs of deflecting plates allow the beam of electrons. An electric field between the first pair of plates deflects the electrons horizontally, and an electric field between the second pair deflects them vertically, the

electrons travel in a straight line from the hole in the accelerating anode to the center of the screen when no deflecting fields are present, where they produce a bright spot. Screen This may be circular or rectangular. Screen is coated with special type of fluorescent material. Fluorescent material absorbs its energy and re-emits light in the form of photons when electron beam hits the screen. When it happens some of them bounces back just like bouncing of cricket ball from a wall. These are called as secondary electrons. They must be absorbed and returned back to cathode, if it is not so they accumulate near screen and produce space charge or electrons cloud. To avoid this, aquadag coating is applied on funnel part of CRT from inside. Advantages of CRT 1. CRT s are less expensive than other display technologies. 2. They operate at any resolution, geometry and aspect ratio without decreasing the image quality. 3. CRTs produce the very best color and gray-scale for all professional calibrations. 4. Excellent viewing angle. 5. It maintains good brightness and gives long life service. Q 3. What are the different techniques for producing color with a CRT, describe each in detail. Ans. This was one the earlier CRTs to produce color displays. Coating phosphors of different compounds can produce different colored pictures. But the basic problem of graphics is not to produce a picture of a predetermined color, but to produce color pictures, with the color characteristics chosen at run time. The basic principle behind colored displays is that combining the 3 basic colors Red, Blue and Green, can produce every color. By choosing different ratios of these three colors we can produce different colors millions of them in-fact. We also have basic phosphors, which can produce these basic colors. So, one should have a technology to combine them in different combinations. There are two popular techniques for producing color displays with a CRT are: Beam Penetration method This CRT is similar to the simple CRT, but it makes use of multi coloured phosphorus of number of layers. Each phosphorus layer is responsible for one colour. All other arrangements are similar to simple CRT. It can produce a maximum of 4 to 5 colours The organization is something like this - The red, green and blue phosphorus are coated in layers - one behind the other. If a low speed beam strikes the CRT, only the red colored phosphorus is activated, a slightly accelerated beam would activate both red and green (because it can penetrate deeper) and a much more activated one would add the blue component also. But the basic problem is a reliable technology to accelerate the electronic beam to precise levels to get the exact colors - it is easier said than done. However, a limited range of colors can be conveniently produced using the concept.

The Shadow - Mask method. This works, again, on the principle of combining the basic colors - Red, green and Blue - in suitable proportions to get a combination of colors, but it's principle is much more sophisticated and stable. The shadow mask CRT, instead of using one electron gun, uses 3 different guns placed one by the side of the other to form a triangle or a "Delta" as shown. Each pixel point on the screen is also made up of 3 types of phosphors to produce red, blue and green colors. Just before the phosphor screen is a metal screen, called a "shadow mask". This plate has holes placed strategically, so that when the beams from the three electron guns are focused on a particular pixel, they get focused on particular color producing pixel only i.e. If for convenience sake we can call the electronic beams as red, blue and green beams (though in practice the colors are produced by the phosphors, and until the beams hit the phosphor dots, they produce no colors), the metal holes focus the red beam onto the red color producing phosphor, blue beam on the blue producing one etc. When focused on to a different pixel, the red beam again focuses on to the red phosphor and so on. Now, unlike the beam penetration CRTs where the acceleration of the electron beam was being monitored, we now manipulate the intensity of the 3 beams simultaneously. If the red beam is made more intense, we get more of red color in the final combination etc. Since fine-tuning of the beam intensities is comparatively simple, we can get much more combination of colors than the beam penetration case. In fact, one can have a matrix of combinations to produce a wide variety of colors. The shadow mask CRT, though better than the beam penetration CRT in performance, is not without it's disadvantages. Since three beams are to be focused, the role of the "Shadow mask" becomes critical. If the focusing is not achieved properly, the results tend to be poor. Also, since instead of one pixel point in a monochrome CRT now each pixel is made up of 3 points (for 3 colors), the resolution of the CRT (no. of pixels) for a given screen size reduces. Another problem is that since the shadow mask blocks a portion of the beams (while focusing them through the holes) their intensities get reduced, thus reducing the overall brightness of the picture. To overcome this effect, the beams will have to be produced at very high intensities to begin with. Also, since the 3 color points, though close to each other, are still not at the same point, the pictures tend to look like 3 colored pictures placed close by, rather than a single picture. Of course, this effect can be reduced by placing the dots as close to one another as possible. The above displays are called refresh line drawing displays, because the picture vanishes (typically in about 100 Milli seconds ) and the pictures have to be continuously refreshed so that the human persistence of vision makes them see as static pictures. They are costly on one hand and also tend to flicker when complex pictures are displayed (Because refreshing because complex).

These problems are partly overcome by devices with inherent storage devices - i.e. they continue to display the pictures, till they are changed or at least for several minutes without the need of being refreshed. We see one such device called the Direct View Storage Tube (DVST) below.

OR Q 3. Describe the concept of Video Controller Raster Scan System.

Q 4. What do you mean by Geometric Transformations? Describe following with Transformation matrix in homogeneous coordinate system. Translation Rotation Scaling HOMOGENEOUS COORDINATES We have seen that basic transformations can be expressed in matrix form. But many graphic application involve sequences of geometric transformations. Hence we need a general form of matrix to represent such transformations. This can be expressed as: Where P and P' - represent the row vectors. T 1 - is a 2 by 2 array containing multiplicative factors. - is a 2 element row matrix containing translation terms. T 2 We can combine multiplicative and translational terms for 2D geometric transformations into a single matrix representation by expanding the 2 by 2 matrix representations to 3 by 3 matrices. This allows us to express all transformation equations as matrix multiplications, providing that we also expand the matrix representations for coordinate positions. To express any 2D transformations as a matrix multiplication, we represent each Cartesian coordinate position (x,y) with the homogeneous coordinate triple (x h,y h,h), such that Thus, a general homogeneous coordinate representation can also be written as (h.x, h.y, h). For 2D geometric transformations, we can choose the homogeneous parameter h to any non-zero value. Thus, there is an infinite number of equivalent homogeneous representations for each coordinate point (x,y). A convenient choice is simply to h=1. Each 2D position is then represented with homogeneous coordinates (x,y,1). Other values for parameter h are needed, for eg, in matrix formulations of 3D viewing transformations. Expressing positions in homogeneous coordinates allows us to represent all geometric transformation equations as matrix multiplications. Coordinates are represented with three element row vectors and transformation operations are written as 3 by 3 matrices. For Translation, we have or

Similarly for Rotation transformation, we have or Finally for Scaling transformation, we have or Q 4. Write down Bresenhams' line drawing algorithm. OR Given coordinate of two points A(x1, y1) and B(x2, y2). The task to find all the intermediate points required for drawing line AB on the computer screen of pixels. Note that every pixel has integer coordinates. Examples: Input : A(0,0), B(4,4) Output : (0,0), (1,1), (2,2), (3,3), (4,4) Input : A(0,0), B(4,2) Output : (0,0), (1,0), (2,1), (3,1), (4,2) Below are some assumptions to keep algorithm simple. 1. We draw line from left to right. 2. x1 < x2 and y1< y2 3. Slope of the line is between 0 and 1. We draw a line from lower left to upper right. Let us understand the process by considering the naive way first.

// A naive way of drawing line void naivedrawline(x1, x2, y1, y2) { m = (y2 - y1)/(x2 - x1) for (x = x1; x <= x2; x++) { // Assuming that the round function finds // closest integer to a given float. y = round(mx + c); print(x, y); } } Above algorithm works, but it is slow. The idea of Bresenham's algorithm is to avoid floating point multiplication and addition to compute mx + c, and then computing round value of (mx + c) in every step. In Bresenham's algorithm, we move across the x-axis in unit intervals. 1. We always increase x by 1, and we choose about next y, whether we need to go to y+1 or remain on y. In other words, from any position (X k, Y k ) we need to choose between (X k + 1, Y k ) and (X k + 1, Y k + 1). 2. We would like to pick the y value (among Y k + 1 and Y k ) corresponding to a point that is closer to the original line. We need to a decision parameter to decide whether to pick Y k + 1 or Y k as next point. The idea is to keep track of slope error from previous increment to y. If the slope error becomes greater than 0.5, we know that the line has moved upwards one pixel, and that we must increment our y coordinate and readjust the error to represent the distance from the top of the new pixel which is done by subtracting one from error. // Modifying the naive way to use a parameter // to decide next y. void withdecisionparameter(x1, x2, y1, y2) { m = (y2 - y1)/(x2 - x1) slope_error = [Some Initial Value] for (x = x1, y = y1; x <= x2; x++) { print(x, y);

// Add slope to increment angle formed slope_error += m; // Slope error reached limit, time to increment // y and update slope error. if (slope_error >= 0.5) { y++; slope_error -= 1.0; } } } How to avoid floating point arithmetic The above algorithm still includes floating point arithmetic. To avoid floating point arithmetic, consider the value below value m. m = (y2 - y1)/(x2 - x1) We multiply both sides by (x2 - x1) We also change slope_error to slope_error * (x2 - x1). To avoid comparison with 0.5, we further change it to slope_error * (x2 - x1) * 2. Also, it is generally preferred to compare with 0 than 1. // Modifying the above algorithm to avoid floating // point arithmetic and use comparison with 0. void bresenham(x1, x2, y1, y2) { m_new = 2 * (y2 - y1) slope_error_new = [Some Initial Value] for (x = x1, y = y1; x <= x2; x++) { print(x, y); // Add slope to increment angle formed slope_error_new += m_new; // Slope error reached limit, time to increment // y and update slope error. if (slope_error_new >= 0) { y++; slope_error_new -= 2 * (x2 - x1); } } } The initial value of slope_error_new is 2*(y2 - y1) - (x2 - x1). Refer this for proof of this value Below is the implementation of above algorithm.

Q 5. Describe the concept of Display Processor in Raster Scan System.

OR Q 5. What do you mean by Composite Geometric Transformation? Find out the composite transformation matrix for translation, rotation and scaling.