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

CGR Notes

Computer graphics is used to display information visually through graphics objects like windows, graphs, and diagrams. There are two types of graphics: raster (image-based) which represents images through pixels, and vector (object-based) which represents pictures mathematically through objects like lines and circles. Computer graphics has many applications including computer-aided design, presentation graphics, image processing, and graphical user interfaces.

Uploaded by

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

CGR Notes

Computer graphics is used to display information visually through graphics objects like windows, graphs, and diagrams. There are two types of graphics: raster (image-based) which represents images through pixels, and vector (object-based) which represents pictures mathematically through objects like lines and circles. Computer graphics has many applications including computer-aided design, presentation graphics, image processing, and graphical user interfaces.

Uploaded by

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

All the BEST ☺ Computer Graphics(CGR)

(3rd Sem - CO/CM)

1. BASICS OF COMPUTER GRAPHICS

 Computer graphics is one of the most effective and commonly used way to
interact with computer.
 It displays information in the form of graphics objects as windows, graphs,
diagrams etc.
 Computer graphics is field of computer science concerned with digital
synthesizing and manipulate of visual content.
 Image:-image is virtual representation of something. Image is a picture that has
been created or copied and stored in electronic form.
 Objects:- is an item within graphic such as circle, square

There are two kinds of graphics.


 An image based (or raster) graphic represents image by measuring the colour at
predefined set of location.
e. g Photographs or screen display, statue, hologram.
 An object based (or vector) graphic represents the picture by describing the
objects in picture in mathematical way.
e. g lines, circle.

Advantages of computer graphics:


 It is one of the most effective and commonly useful way to communicate the
processed information to the user
 It displays information in the form of graphics objects such as pictures, charts,
graphs, and diagrams which takes it possible to express data in pictorial form.
 The pictures or graphic object may be an engineering, drawing, business,
animated movie.

Pixel:
 The image that is displayed on the screen is composed of thousands of small dots,
these are called pixels, it represents the smallest piece of screen that can be
controlled individually.

Resolution:
 Total no of pixels contained on display monitor express in terms of number
pixels on horizontal axis and number of pixels on vertical axis.
 If an image has m rows and N columns then its resolution can be defined as
MXN.
 Image resolution is described in PPI (Pixels per inches) which refers to how
many pixels are displayed per inch of an image.
 Higher pixel resolution the higher is quality of image.
E.g 64X480, 1024X768, 800X600.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 1
1
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Aspect Ratio:
It is the ratio of number of X pixels to number of Y pixels. The standard aspect
ratio for PC is 4:3
Text mode Graphics mode
1. when you start a program me under 1. when you start a program under
MS-Das the computer’s screen is in windows the computers screen is in
character (Text) mode. graphic mode.
2. in this every character is drawn as dot 2. in this everything is drawn one dot
pattern. (pixel) at a Time.
3. in text mode display configuration 3. In graphics mode it show 640 pixels
allows 80 characters across each row and horizontally and 480 pixels horizontally
25 lines of characters. and 480 pixels vertically.
4. in this character always have the same 4. In this, each pixel can be any of 16
font and colour of each letter. And its colours and different types of fonts.
background can be changed.
5. the character mode displays are faster 5. Graphics mode displays are slower than
than graphics mode display text mode display.
6. in this there is no way to show pictures 6. In this we can display Pictures, charts,
graphs.

Basic graphics pipeline: -


 It is conceptual model that describes what stops a graphics system needs to perform
to transfer to 2D screen.
 It can be divided into 3 main parts
1.+ Application
2. +Geometry
3. +Rasterization.

Application:
 In this change are made to the scene as required.
Geometry: It is responsible for majority of operations with polygons and their vertices.
It can be divided into 5 tasks.
1 model and camera transformation.
2. Lightning
3. Projection
4. Clipping
5. Window viewpoint transformation,
1. Model and camera transformation:
This converts object coordinates into camera coordinates.
2 lighting:-
Applied to determining its colour
3. Projection: - it transforms 3D area into 2D area.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 2
2
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Clipping: - this removes the parts of image that are not visible in 2D screen view
window viewpoint transformation: - in order to output the image to any target are
(viewpoint) of screen window viewpoint transformation is applied.

Rasterization:-
In this image described in vector graphics format (shapes) is converted into raster
image (pixels) for output on video display or printer or for storage in bitmap file format.

computer
In graphics we typically use at least 3 coordinate systems.

1. Object coordinate system:


local coordinate in which points and other object geometry are given.

2. Camera coordinate system:-


Camera coordinate system in which origin defines center of projection of camera.
3. world coordinate systems:-
Common reference frame for all object in scene.

Bitmap and vector based graphics:-


 Digital images are divided into two distinct categories.
 Bitmap files
 2. Vector graphics

Bitmap based graphics:-


Bitmap files are stored as series of tiny dots called pixels. Each pixel is actually a very
small square that is assigned a color. And then arranged in pattern to form the image.
When you zoom in on bitmap image you can see the individual pixel that make up that
image.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 3
3
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Bitmap graphics can be edited by erasing or changing color of individual pixel using
program me such as adobe photoshop. Bitmap consists of matrix of individual pixels
that all have their own colour .using bits.

Types of bitmap image:-


Bitmap contain any number of colours:
1. line art:-
There are images that only contain various two colours usually black and white. Images
use only 1 bit to define each.
2. Grayscale images:
These images contain various shades of gray as well as pure black and white typically
256 shades of gray (8 bit) are used.
3) Multitones:
Such images contain shaded of two or more colours.
4. full colour images:
The colour information can be described using number of colour spaces CMYK,RGB
Bitmap data can be saved in wide variety of file format.
e.g BMP, GIF,JPEG,TIFF

vector graphics:
vector images use mathematical formulas to draw lines and curves that can be
combined to create an image from geometric objects such as circles and polygons.
 Vector images are edited by manipulating the lines and curves that make up image
using program me such as adobe illustrator.
 Vector images tend to be smaller than bitmap image. Since bitmap images store colour
information for each individual pixel. And vector image just stores mathematical
formulas that make up image which take up less space.
 Vector images are scalable without losing the quality.
E.g. EPS, PSD etc.

Applications of computer graphics: -


1. Computer aided Design (CAD).
2. Drawing and art.
3. Presentation graphics.
4. Image processing.
5. Graphics user interface
6. Entertainment
7. Education and training
8. Communication.
9. Interactive graphics

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 4
4
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

1. Computer aided design (CAD):-


 CAD are used in architectured and designing process graphics.
 CAD is used in design of building, automobiles, aircraft, spacecraft, watercraft,
computers textiles and many other products.

2. Presentation graphics (plotting of graphics and charts):-
 it deals with graphical representation of information.
 it is commonly used to summarize financial, statistical, mathematical and economic
data for research reports etc.
 it is used to create 2D and 3D graphs. In the form of histogram, bars and pie charts

3. Drawing and arts:


 there are lot of development in tools provided by computer graphics.
 This allows user to create artistic pictures which express massages and attract
alternatives such as pictures are very useful in advertising.

4. Image processing: -
Image processing applies technique to modify or interpret existing pictures such as
photographs and scanned images

5. Graphical user interface:


It allows people to Interact with computer and computer controlled devices like icons
minus along with text, labels, to represent the information only by mouse click etc.

6. Entertainment:
 Computer graphics method is used in making music videos, television shows, games,
cartoon movies etc.
 Computers are used create realistic special effect digital imaging, animation,
background sound.

7. Education and training:
 Teacher use computers to prepare their lectures and being their classrooms real life
examples to provide the framework which is important for learning.
 in medical colleges, students are taught to operate a body in stimulated environment
on computer.

8. Communication:
With video conferring two people can communicate with each other without being
physically present at common place.

9. Interactive graphics:
 This allows comprehensive, high bandwidth, user computer interaction.
By interacting, graphics produces higher quality and accurate results without
incurring much expenditure on analysis and design phase

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 5
5
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Display devices:
The display devices are also known as output devices. The operations of most
monitors is based on standard cathode- ray- tube (CRT) there are two techniques
used for producing images on CRT screen.
1. Vector scan/random scan
2. Raster scan.
1. Vector scan:
 Random scan display uses the technology to draw directly the pictures on screen i.e
the beam is displayed on position where pictures has to be displayed.
 random scan monitors draw a picture one line at a time and for this reason are also
referred to as vector display file.
 refresh rate on random scan system depends on number of lines to be displayed.
Pictures definition is stored as a set of line drawing commands in an area of memory
referred to as refresh display file.
 Refresh display file is also called as display list, display program or refresh buffer
 To display a specified picture, the system cycles through the set of commands in the
display file, drawing each components line in turn.
 After all time drawing commands have been processed, the system cycle. Back to the
first line commands in the list.
 Random scan displays are designed to draw all the component lines of picture 30 to
60 times each second.

Vector scan CRT:


the architecture of vector display
 the typical vector display architecture consists of display controller, central
processing unit (CPU) display buffer memory and CRT.
 a display controller is connected as an I/O peripheral to central processing unit
(CPU).
 The display buffer memory stores the computer produced display list or display
program.
 the program contains points and lines plotting commands with (x,y) or (x,y,z) end
point coordinate as well as character plotting commands.
 the display controller interprets commands for plotting points, and lines and
characters and sends digital and point coordinates to vector generators.
 The vector generator then converts the digital coordinates values to analog voltages
the beam deflection circuits that displace on electron beam consisting on CRT
phosphor coating.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 6
6
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Raster scan display:


 The architecture of raster consist of display controller, central processing unit (CPU),
video controller, refresh buffer, keyboard, mouse and CRT
 The display image is stored in the form of IS and OS in refresh buffer.
 The video controller reads this buffer and produces the actual image on screen
 It does this by scanning one scan line at a time, from top to bottom and then back to
top.
 It does this by scanning one scan line to a time, from top to bottom and then back to
top.
 In this method the horizontal and vertical deflection signals are generated to move the
move the beam all over the screen in pattern.

 When the beam is moved from left to right it is ON. The beam is OFF, when it is
moved from the right to left as shown by allotted line
 When beam reaches the bottom of screen it is made OFF and rapidly back to top left to
start again.
 In raster scan display special area of memory is dedicated to graphics only. This
memory area is called frame buffer. Which holds the set of intensity values are
retrieved from frame buffer and displayed on screen on row at a time.
On black and white system one bit per pixel the frame buffer is commonly called
bitmap. For system with multiple bits per pixel, the frame buffer is other referred to
as pixma.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 7
7
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Vector (random) scan display Raster scan display

1. in this beam is moved between the In this beam is moved all over the
end points of graphics primitive screen one scan line at a time from
top to bottom then back to top
2. flickers when the number of The refresh process is independent
primitives in buffer becomes too to complexity of image
large
3. scan conversion is not required Scan conversion is required
4. vector displays draw a continuous Can display mathematically smooth
and smooth lines lines, polygons, and boundaries of
curved primitives.
5. cost is more Cost is less
6. only draws lines and characters. Has ability to display areas filled
with wild colours or patterns
7. only Draws lines of characters Has ability to display area filled with
solid colours or patters .

Flat panel displays:


 Flat panel display refers to class of video devices that have reduced volume, weight, and
power requirement compared to CRT.
 They are thinner than CRT.
 They are two types of flat panel displays. Emissive displays and non-emissive displays.

Emissive displays:
They convert electrical energy into light energy. Plasma panels, thin film electro
luminescent displays and light emitting diodes are examples of emissive display

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 8
8
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Non emissive displays:-


They use optional effects to convert sunlight or light from some other source into
graphics Patterns.
Liquid crystal display is an example of non-emissive flat panel display.

LED display:
It is flat panel display that uses an array of light emitting diodes as pixels for a video
display.
An LED panel consist of several LEDs, where as an LED display consist of several LED
panels
A light emitting diode is made up of semiconductor chip which is surrounded by
transparent plastic case.
The plastic case allows the light to pass through it.
The emission of different colours including ultraviolet and infrared light depends on
semiconductor material which is used in diode.

Advantages of LED displays:


Slim design
 Brighter images
 Better colour
 Flicker free images
 Better picture quality
 Longer life span
 Lower power consumption.

Disadvantages of L
ED displays:
 LEDs are more expensive than conventional lighting technologies.
 LEDs can shift colour due to age and temperature.
 Contrast ratio are not consistent.

Application:
 Used for signs and billboards.
 Used for variable-message sign on highways.
 Used in modern electronic devices such as mobile phones, TVs, tablets, computer
monitors, laptops screen etc.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 9
9
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

LCD displays:
 It has crystalline arrangement of molecules
 Two glass plates, each containing light polarizer at right angles to other plate
sandwich the liquid crystal material.
 Rows of horizontal transparent conductors are built into one glass plate and columns
of vertical conductor are put into other plate.
 The interaction of two conductors defines pixel position
 In ON state polarized light passing through material is twisted so that it will be
pass through opposite polarizer to turn off the pixel, we apply a voltage to two
intersecting conductors to align the molecules so that light is not twisted.

Advantages of LCD displays:


 Low cost
 Low weight
 Small size
 Low power consumption.

Plasma displays:
 Plasma panel display writes images on display surface point by point, each point
remains bright after it has been intersected
 it consists of two plates of glass with thin, closely spaced gold electrodes.
 The gold electrodes are attached to inner faces and covered with a dielectric
material.
 These are attached as series of vertical conducting ribbons on one glass plate and set
of horizontal ribbons on another glass plate.
 The space between two glass plates is filled with neon gas and sealed.
 By applying voltage between electrodes gas is made to behave if it Is divided into
tiny cells.

Advantages:
 Refreshing is not required.
 Produces a very steady images, flicker free
 Less bulky than CRT.
 Allows selective writing and selective erasing at speed of about 20 sec per cell.
 It has flat screen and it is transparent, so the displayed image can be superimposed
with pictures from slides or other media projected through the rear panel.

Disadvantages:
 Radially poor resolution of about 60 dots per inch.
 It requires complex addressing and writing
 Costlier than CRTs

Touch screen:
 When you place fingertip directly on computer screen, touch screen accepts input.
 Generally, this method is used to make a choice from menu.In this the sensors are
used on screen’s surface to detect the touch of finger it needs dirt free environment.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 10
10
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Application:
 Automated teller machines(ATM)
 Public information kiosks.
 Fast food restaurants.
 Department store.
 Drug store
 Supermarkets.
 Lottery centers

Output primitives:

 The basic attributes of straight line segment are its types Output primitive: line,
polygon, marker, text line. The basic attributes of straight line segment are its
width, its color.
 Line Line polygon, market, text line.
(x1, y1, x2, y2)
Where x1, y1 are starting point and x2, y2 are ending points.
Polygons:
It is closed figure where sides are line segment.
Rectangle (x1, y1, x2, y2)
Triangle (x1, y1, x2, y2, x3, y3,)
Marker symbol is single character that can be displayed in different colors in different
sizes.
Text, there are many text option that can be made available to graphics programmers.
There is the choice of font which is set of character with particular design style such as
character with particular design such as courier, areal, times new roman and so on. We
can select text colour also.

Graphics functions and standards:


Need for graphics standard.
For exchange of drawing database among software packages.
Need for exchanging graphic data between different computer systems
The need for portability of geometric model among different hardware platforms.

Types of graphic standards.


 GKs (graphical kernel system)
 PHGS (programmers hierarchical interface graphics)
 OREC
 GKS-3D
 IGES(initial graphic exchange specification)

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 11
11
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

GKS:
 GKS stands for graphical kernel system
 It is accepted as international standard for two-dimensional graphics.
 Designed to be portable across different programming language, graphic devices
and hardware.

Functions:
 The GKS function for drawing line segments is called polyline
 The polyline function takes an array of X-Y coordinates and draws line segments
connecting them primitives in GKs
 Poly marker function marks sequences of points with same symbol.
 TEXT function draws a string characters

Latest trends in computer graphics:


Scalability:
 To cope with huge amounts of data, highly parallel computers and distributed
devices.

semantics:
 Extract the meaning from data and context and use it for better insight.

fusion:
Combine multiple techniques, data streams and models to solve complex problems.

interaction:
 Combine multiple and iniquitous input devices to create ergonomic user interfaces

Acquisition:
 Process data from various impact sources to deal with missing data contradictor and
uncertainty.

Virtual reality and augmented reality:


Virtual reality:

 It is referred as immersive multimedia.


 It is computer stimulated environment that can stimulate physical presence in place
in real world or imaginary world.
 The person becomes part of virtual world and is able to manipulate objects or
perform some serious of actions.
 It can be recreate sensory experiences including virtual taste, sight, smell, sound,
touch etc.
 The input devices like keyboard, mouse or multi model devices like wired gloves,
boom arm helps user to interact with virtual environment.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 12
12
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Components of virtual reality:


 It includes
 Virtual world
 Virtual reality engine
 Software/database
 User interface
 Inputs
 Output

Components of typical UR system:


 The components of virtual system are divided into two parts
Internal components:
 Virtual reality engine stimulation engine, graphic engine, software, / database and
user interface.

External components: inputs and outputs.

 Scene database includes geometric representations and attributes for all objects
within the environment
 The graphic engine generates the image that seen by user. While doing so the scene
database, viewer’s current position and orientation is taken into consideration,
 The stimulation engine performs main task i.e it concerns about dynamic of
environment over time and how it responds to user’s actions.
 The user interface controls the user navigation and interaction with virtual
environment. It acts as buffer between virtual world software and input devices
being used.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 13
13
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Advantages of virtual reality:


Training and education:
 Using VR system the process of training and education can be done more effectively.
Entertainment and gaming:

 With the help of specialized equipment user can be enjoy the environment and
gaming as VR system enables the user to feel VR system enables the user to feel
his/her presence in virtual world.
Help and healing:

 VR system are very much helpful in rehabilitation of patients suffering from any
kind of phobia or chronic disease.

Architecture and planning:


 VR system helps in designing and planning of projects before starting the actual
implementation.
Augmented reality:

 A VR system attempts for totally immersive virtual environment in which the user
is performing his task. An AR system combines the real and virtual in order to assist
the user in performing his task.
 Augmented reality is halfway point between non-immersive and fully immersive VR
system.
 The application of AR system in surgery include visualization and training support
as well as the collection of 3D patient data.AR system are used in military
applications tracking systems, medical surgeries etc.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 14
14
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

2.RASTER SCAN GRAPHICS

Line is straight object with no curves, no thickness and it extend in both directions
without end if it does not ends it is called line segment.
The process of turning on the pixels for a line segment is called vector generation or line
generation. The algorithm for them are known as vector generation algorithm or line
drawing algorithms.
Line drawing algorithm.

Digital differential analyzer (DDA)


Bresenham’s algorithm.

 Digital differential analyzer (DDA) line drawing algorithm


The vector generation algorithm which steps along the line to determine the pixel which
should be turned on are sometimes called digital differential analyzer (DDA).
Slop of straight line is
y y2 − y1
m= =
x x2 − x1
y −y
y = 2 1 .x
x2 − x1
x −x
x = 2 1 .y
y2 − y1

xi +1 = xi + x
x2 − x1
= xi + y
y2 − y1
yi + 1 = yi + y

y2 − y1
= yi + x
x2 − x1
If x  y then
x = 1
else
y = 1
If x = 1
xi + 1 = xi + 1
y2 − y1
yi + 1 = yi +
x2 − x1
If y = 1

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 15
15
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

yi + 1 = yi + 1
x2 − x1
xi + 1 = xi +
y2 − y1
DDA line algorithm.
1. real the line end points (x1,y1) and (x2,y2) such that they are not equal.
2. x = x2 − x1 & y = y2 − y1
3. if ( x  y ) then
Length= y
End if
4. x = ( x2 − x1 ) / length
5. y = ( y2 − y1 ) / length
[The sign function makes the algorithm to work in all quadrant. it returns -1, 0, 1
depending whether the arguments is <0, =0,> 0 respectively.]
Plot (integer (x), integer (y).
6. i=1
[begins the loop in this loop points are plotted while (i length)]
x = x + x
y = y + y
Plot (integer (x), integer (y).
I = i+1
}
7. Stop:
Consider the line from (0, 0) to (4,6) use simple DDA algo to rasterize this line.
:-- x1=0 y1= 0 x2=4 y2=6
Together
x = x2 − x1 = 4 − 0 = 4
y = y2 − y1 = 6 − 0 = 6
y  x Length= y − 6
x = ( x2 − x1 ) / Length = 4/6=2/3
y = ( y2 − y1 ) /
Length = 6/6=1

Initial value for


x = 0 + 0.5  sign( x)
= 0 + 0.5*1
= 0.5
y = 0 + 0.5* sign( y )
= 0 + 0.5*1
= 0.5

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 16
16
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

I X Y Plot (x,y)
1 0.5 0.5 (0,0)
2 1.66 1.5 (1,1)
3 1.83 2.5 (1,2)
4 2.5 3.5 (2,3)
5 3.16 4.5 (3,4)
6 3.83 5.5 (3,5)
7 4.5 6.5 (4,6)

Advantages of DDA algo:


 It is simplest algorithm and it does not require special skills for implementation
It is faster method for calculating pixel Pontius than direct use of equation y=mx + b

Disadvantages:
 Floating point arithmetic in DDA algorithm is time consuming
 The algorithm is orientation dependent hence end point accuracy is poor.

C program me for DDA line algo


#include, <stdioh>
#include<graphics.h>
#include<math.h>
{void main}
Float x1, y1, x2, y2, dx, dy, length;
Derscre;
Print (‘’ enter the values x1, x2, y2, y2)
Scarif (‘’%f%f%f%fn, & x1, & x2, & y1, & y2)
Deteograph (&gd, gm);
Initgraph (&gd, &gm,’’c: tc\\bgi\\ ‘’);
dx= abs (x2-x1)
dy= abs (y2-y1),
if (dx>=dy)
length = dx
else
length = dy
dx= (x2-x1)
dy=(y2-y1),
if (dx>=dy)
length=dx
else
length=dy
dx= (x2-x1)/length;
dy=(y2-y1)/length;
x=x1+0.5*sign(dx);
y=y1+0.5*sign(dy;)

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 17
17
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

putpixel(x,y,15);
i=1;
while (I<=length)
x=x+dx;
y=y+dy;
putpixel(x,y,15)
i=i+1;
delay (100);
}
getch
closegraph ();
}

Bresenham’s line growing algo.


It uses only interior addition and subtraction and multiplication by 2 and we know
computer can perform this operation rapidly. Hence it is efficient method for line
drawing.
The basic principle of Bresenham’s line algorithm is to select the optimum raster
locating to represent of straight line.
To accomplish this the algorithm always increments either x or y by one unit
depending on the slope of line.
The increments in other variable is determined by examining the distance between the
actual line location and nearest pixel. This distance is called decision variable or error.
In mathematical terms error or decision variable is defined as.
e=DB-DA or e=DA-DB
If let’s take e= DB-DA
If e>0 then it implies e= DB >DA
That is the pixel above the line is closer to the the line is closer to true line.
If e<0 then it implies DA>DB i.e the pixel below the true line is closer to true line.

Y= mx+b

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 18
18
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Bresenham’s line algo:


1. read the line end points (x1, y1) and (x2,y2) such that they are not equal.
2. x = x2 − x1 y = y2 − y1
3. x = x1
Y = y1
Plot (x,y).
4. e = 2* y − x
5.i = 1
6. while (i>0)
{
y=y+1
e = e − 2x
}
X = x+1
e = e + 2y.
7.Plot (x,y)
8.i = i+1
9.if ( i  x ) then go to step 6
10. stop.
Consider the line from (5,5) to (13,9). Use the Bresenham’s algorithm to rasterize the
line.
x = x2 − x1 y = y2 − y1
= (13 − 5) = ( 9 − 5)
=8 = 4
X = x1 = 5 y = y1= 5
e = 2xy − x
= 2*4-8
=0
If e<0 else
{x=x+1 }x=x+1
Y=y y=y+1
e = e + 2y e = e + 2y − 2x
} }
X=5 y=5 Plot (x,y) i.e 5,5
I=1 e<0 i.e 0 < 0 false
X=x+1=5+1=6
Y=y+1=5+1=6
e = e + 2y − 2x
=0+2x4-2x8
=0+8-16
=-8

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 19
19
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Plot (x,y) Plot (6,6)


i=2 e<0 T x=x+1=7
y=y=6
e = e + 2y =-18+2x4=-8+8
=0
Plot (x,y) plot (6,6)
I=3 e<0 0<F
X=x+1 =7+1=8
Y=y+1 =6+1=7
e = e + 2y − 2x
=0+2x4-2x8=8-16=-8
Plot (x,y) Plot (8,7)
I=4 e< 0 -16<0 T
X =x+1 =8+1=9
Y=y = 7
e = e + 2y =-8+2x4=-8+8=0
Plot (x,y) Plot (9,7)
I= 5 e < 0 0<0 F
X=x+1=9+1=10
Y=y+1=7+1=8
e = e + 2y − 2x
= 0+2x4-2x8=2x4-16=8-16=-8
Plot (x,y) Plot (10,8)
I=6 e<0 -8<0 T
X=x+1=10+1=11
Y=y=8
e = e + 2y =-8+2x4= -8+8=0
Plot (x,y) plot(11,3)
I=7 e<0 0<0 F
X=x+1=11+1=12
Y=y+1=8+1=9
=0+2x4-2x8=8-16=-8
Plot (x,y) Plot (12,9)
I=8 e < 0 -8 < 0 T
X=x+1 =12+1=13
Y=y
e = e + 2y =8+2x4=-8+8=0
Plot (x,y) plot (13,9)

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 20
20
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

I E x y Plot (x,y)
0 5 5 5,5
1 -8 6 6 6,6
2 0 7 6 7,6
3 -8 8 7 8,7
4 0 9 7 9,7
5 -8 10 8 10,8
6 0 11 8 11,8
7 -8 12 9 12,9
8 0 13 9 13,9

Circle generating algo:


Symmetry of circle
A circle is symmetrical figure. It has eight –way symmetry.

Digital differential analyzer (DDA) circle drawing algorithm.


Equation of circle is
X2+y2=r2
2xdx+2y dy=0
Xdx + ydy = 0
dy x
=−
dx y
We can construct the circle by using incremental x value, x=y and incremental y
value y=-x where  is calculated from radius of circle as shown below.
2n−1  r  2n r: radius of circle
=2-n
If r=50 then n=6 so that
32  50  64
=2-6=0.0156
Applying these incremental steps we have
Xn+1=xn+yn
Yn+1=yn-xn+1
Point plotted using above equation give the spiral instead of circle. To get circle we have
to make one correction in equation we have to replace Xn by Xn+1 in equation of Yn-yn
yn +1 = yn −  xn +1

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 21
21
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Algorithm:
1. Read the radius r of circle and calculate value of E
2. start x=0
Start-y=x
3. x1=start x
Y1=start –y
4. do
{x2=x1+y1
Y2=y1-x2
X1=X2;
Y1=y2
} while (y1-start_y)< or (start_x-x1)>
5. stop.

Bresenham’s circle drawing algo.

This distances of pixels A and B from origin given as


DA = ( xi + 1)2 + ( yi)2 &
DB = ( xi + 1)2 + ( yi − 1)2
Now the distances of pixels A and B from true circle are given as
SA=DA-r SB=DB-r
To avoid square root term in derivation decision variable SA and SB are defined as
A =DA2-r2
B =DB2-r2
A = DA2-r2
= (xi+1)2+yi2-r2
B= DB2-r2
A = D 2 B − r 2
A = ( Xi + 1) 2 + yi 2 − r 2

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 22
22
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

B = D 2 B − r 2
A = ( Xi + 1) 2 + ( yi − 1) 2 − r 2
A will always be positive and B will always be negative
Di=A+B
=(xi+1)2+yi2-r2+(xi+1)2+(yi-1)2-r2
=2(Xi+1)2+yi2+(yi-1)2-2r2
To find initial value of decision parameter at starting point Xi=0, yi=r
d0 = 2(0+1)2+r2+(r-1)2-2r2
= 2+r2+r2-2r+1-2r2
= 2+2r2-2r+1-2r2
= 3-2r
For di< 0 Xi+1 = Xi+1 yi+1 =yi
For di > 0 Xi + 1 yi+1 =yi-1
i = 2( xi + 1) 2 + yi 2 + ( yi − 1) 2 − 2r 2
di+1 = 2(Xi+1+1)2+y2i+1+(yi+1-1)2-2r2
for di< 0 Xi+1=Xi+1 yi+1=yi
di=2(xi+1+1)2+yi2+(yi-1)2-2r2
= 2(xi+2)2+yi2+(yi-1)2-2r2
= (xi2+4xi+4)+yi2+yi2-2yi+1-2r2
= 2xi2+8xi+8+2yi-2yi+1-2r2
=2xi2+4Xi+2+6+4xi+2y2i-2yi+1-2r2
=2(xi2+2xi+1) + 6+4xi+2(yi-1)2-2r2
=2(Xi+1)2+6+4xi+2(yi-1)2-2r2
=di +4Xi + 6

For di>0 xi+1=Xi+1 yi+1 = yi-1


= di +1 = 2( X i +1 + 1)2 + y 2i +1 + ( yi +1 − 1)2 − 2r 2
= 2( xi + 1 + 1) 2 + ( yi − 1) 2 + ( yi − 1 − 1) 2 − 2r 2
= 2( xi + 2) 2 + ( yi − 1) 2 + ( yi − 2) 2 − 2r 2
= 2( xi 2 + 4 xi + 4)2 + ( yi − 1)2 + ( yi 2 − 4 yi + 4)2 − 2r 2
= 2 xi 2 + 8 xi + 8 + ( yi − 1) 2 + yi 2 − 4 yi + 4 − 2r 2
= 2 xi 2 + 4 xi + 4 xi + 2 + 6 + ( yi − 1) 2 + yi 2 − 4 yi − 4 − 2r 2
2( x 2i + 2 xi + 1) + 4 xi + 6 + ( yi − 1) 2 + y 2i − 4 yi + 4 − 2r 2
= 2( x 2i + 2 xi + 1) + 4 xi + 6 + ( yi − 1) 2 + y 2i − 4i + 4 − 2r 2
= i + 4 xi − 4 yi + 10
= i + 4( xi − yi) + 10
For initial point
I = 3-2r
For I < 0 Xi+1=Xi+1 Yi+1=Yi
For di0 Xi+1=Xi+1 Yi+1=Yi-1

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 23
23
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Algorithm to plot 1/8 of circle using Bresenham’s algo.


1. read the radius (r) of circle
2. d=3-2r
3. X=0, y=r
4.do
{
Plot (x, y)
If (d<0) then
{
D=d+4x+6
}
Else
{ d=d+4(x-y)+10
Y=y-1
}
X=x+1
}
X+x+1
}
While (x<y)
5. stop.
Calculate the pixel position along circle path with radius r=0 centered on the origin
using Bresenham’s circle drawing algo from (0,10) to point X=y
D=3-2r=3-2*10 =3-20=-17
D=-17
X=0 y=r=10 plot (x,y) (0,10)
d<0 -17<0
d =d+4x+6 =-17+4 x0+6
d=-11
x=x+1 =0+1 +1
y=y =10
plot (x,y) (1,10)
d<0 -11< 0
d=d+4x+6= -11 +4x1 +6
=-11+4+6
d = -1
X=X+1 =1+1=2
Y=y=10
Plot (x,y) ( 2,10 )
D<0 -1<0
d = d+4x+6 =-1 +4x2+6
d =13

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 24
24
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

x=x+1=2+1=3
y=y=10
plot (x,y)
d0 13>0
d = d + 4(x-y) +10
=13+4(-7)+10
=13-28+10
D =-5
X=x+1=3+1=4
Y=y-1=10-1=9
Plot (x,y) (4,9)
d<0 -5<0
d =d+4x+6
=-5+4x4+6
=-5+16+6
=17
X=x+1 = 4+1=5
Y=Y=9
Plot (x,y) (5,9)
d0 170
d=d+4(x-y) + 10
=17+4(5-9) + 10
=17-16+10
=11
X=x+1=5+1=6
Y=y-1=9-1=8
Plot x, y (6,8)
d0 110
d=d+4(x-y) + 10
= 11+4(6-8) + 10
=11-8+10
=13
X=x+1=x+1=6+1=7
Y=y-1 =8-1=7
Plot (x,y) (7,7)
X Y d
0 10 -17
1 10 -11
2 10 -1
3 10 13
4 9 -5
5 9 17
6 8 11
7 7 13

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 25
25
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Polygons:
When starting point and terminal point of any polyline is same i.e. when polyline is
closed then it is called polygon.
Types of polygon:
There are two types of polygon.
 Convex
 Concave

Convex:
A convex polygon is polygon in which in which the line segment joining only two points
within the polygon lies completely inside the polygon.

Concave:
A concave polygon is polygon in which the line segment joining any two points within
the polygon may not lie completely inside polygon.

Polygon is a simple if it is described by a single non intersecting boundary, otherwise it


is said to complex.

Intersections of line segment with

Two methods for testing pixel inside of polygon


 Even odd method
 winding number test.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 26
26
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Even odd method:


 constant a line segment between point in question and points known to be outside
the polygon.
 now count how many inter sections of line segments with polygon boundary occur.
 if there are an odd number of intersections then points in question is inside. (0I).
 otherwise it is outside (E-0)

If the intersection point is vertex of polygon then we have to look at other end points of
the two segments which meet at this vertex. If these points lie on same side of
constructed line, then the points in question counts as an even number of intersections
I they lies on opposite side of constructed line, then the point is counted as single
intersect
Winding number method:-

In winding
number method, we have to picture a line segments running from outside the polygon
to the points to the point in equation and consider sides which it crosses.
Draw the edge.
We must select a line that should not pass through any vertices. Polygon edges crossed
by this line could be drawn staring below the line could be drawn starting below the
line, cross it and end above the line or starting above the line, cross it and end below
the line.
In first case we have to give direction number as -1 and in sectioned case we have give

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 27
27
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

direction number as 1.
The sum of the direction numbers for the sides that the constructed horizontal line
segments is called winding number for point in question.
For polygon or two dimensional objects.
The points is said to be inside when the value of winding number is non zero.
Non zero – inside.
Zero –outside (0).

Polygon filling:
Polygon filling algorithm and scan line algorithm. Are classified as seed algorithm and
scan line algorithm.

Boundary fill algorithm:


In this method, edge of polygon are drawn. Then staring with some seed, any point
inside the polygon we examine the neighboring pixels to check whether the boundary
pixel is reached. If boundary pixel are not reached pixels to check whether the boundary
pixel is reached. If boundary pixel are not reached pixels are highlighted and process is
continued until boundary pixels are reached.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 28
28
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Boundary defined as regions may be either 4-connected or 8 connected as shown in


figure.
If region is 4 connected, then every pixel in region may be reached by combination of
moves in only tour directions left, right, up, and down.
For 8 connected region every pixel in region may be reached by a combination of moves
in two horizontal, two vertical and four diagonal directions
Pseudo code for boundary algo
Boundary fill (x, y,+ - color and b colour)
If (get pixel (x,y)!=b__colour & &
get pixel (x,y)!=Color)
{putpixel (x,y, color)
Boundary fill (x+1, y,F_color,b-color);
Boundary fill (x, y+1, color-color);
Boundary fill (x-1, y, f color, b color):
Boundary fill (x, y-1,) f-color, b-color);}

Flood fill algorithm:


Sometimes it is required to fill in an area that is not defined within a single color
boundary. In such cases we can fill areas by replacing a specified interior colour instead
of searching for boundary colour. This approach is called flood filled algorithm.
Like boundary fill algo, we start with some seed and examine the neighboring pixels.
Hence pixels are checked for specified interior color instead of boundary color and they
are replaced by new color.
Pseudocode for flood fill algo.
Flood (seed, seed_y, foreground, background_col &&)
{(getpixel (seed-x, seed-y)! = background_col && getpixel (seed_x, seed_y)! =
foreground_col);
Flood (x+1, y, foreground-col, background-col);
Flood (x, y+1, foreground-col, background-col);
Flood (x-1, y, foreground-col, background-col;)
Flood (x, y-1, foreground-col, background-col);}

Scan line algorithm:


1. Read n, the number of verifies of polygon.
2. Read x and y coordinate of all verifies in array x[n] & y[n].
3. Find y min and y max.
4. store the initial x value [x1] y values y1 and y2 for two end points and x increment x
from Scan line for each edge in the array edges [n] [4].
While doing this check that y1&y2 if not interchange y1&y2 and corresponding x1 and
x2 so that for each edge, y1 represents its maximum y coordinate and y2 represent its
minimum y coordinate.
5. Sort the rows of array, edges, [n] [4] in descending order of y1 , descending order of y2
and ascending order of x2.
6. Set y=ymax.
7. Find the active edges and update active edge list
If (y > y2 and y<y1)

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 29
29
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

{Edge is not active}


8. Compute the x intersects for all active edges for current y value initially x-intersect is
X1 and X intersect for successive y values can be given as
Xi+1X1+x
y −y
Where x=-ym and m = 2 1
x2 − x1
9. If x intersect is vertex x-intersect=x1 and y=y1 then apply vertex test to check
whether to consider one intersect or two intersects. To consider one intersect or x-
intersects. Store all x- intersects. Store all x-intersects in x- intersect [] array.
10. Sort x-intersect [] array in ascending order.
11. Extract pairs of intersects from the sorted x-intersect [] array.
12. Pass pairs Df x values to line drawing routine to draw corresponding line segments
13. Set y = y-1
14. Repeat step 7 through 13 unit y  y min.
15. Stop.

Character generation method.


These are basic 3 methods of generally characters.
1. Stroke method.
2. Starburst method.
3. Bitmap method.

Stroke method:
This method uses small line segments to generate a
character. The small series of line segments are drawn
like a strokes of pen forms character is shown in fig.

Starburst method:-
In this method fix pattern of line
segments are used to generate
characters. As shown in fig. there
are 24 line segments.

Bitmap method:
 It is also called dot matrix because in this method characters are represented by an
array of dots in matrix form.
 It is two dimensional array having columns and rows. an 5x7 array is commonly
used to represent characters.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 30
30
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

3.Overview of transformations
We can make changes in an image by performing mathematical operations on
coordinates is known as transformation

2D transformation:
Translation:
 It is process of changing the position of an object in a straight line path from one
coordinate location to another
 we can translate two dimensional point by adding translation distances tx and ty to
the original coordinate position (x, y) to move the point to new position (x’ , y’)

X’=x+tx y’=y+ty
P’=P+T
 x '   x   tx 
 y '  =  y  +  ty 
     
1 0 0 
Tx = 0 1 0 
tx ty 1

Rotation:
A two dimensional rotation is applied to an object by repositioning it along a circular
path in the xy plane is known as rotation.

x = r cos  y = r sin 
x ' = r cos( +  ) y = r sin( +  )
= r cos  cos  − r sin  sin  y = r sin  cos  + r cos  sin 
= r cos  − y sin  y = y cos  + x sin 

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 31
31
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

P’=P.R
Where
cos  sin  
R= 
− sin  cos  
For negative value of  i.e for clockwise rotation, the rotation matrix becomes
cos(− ) sin(− ) 
R= 
 − sin(− ) cos(− ) 

cos  − sin  
R=
sin  cos  
A point (4,3) is rotated counter clockwise by an angle of 450. Find the rotation matrix
and the resultant point.
cos  sin  
R=
 − sin  cos  
=450
cos 45 sin 45 1/ 2 1/ 2 
R= = 
 − sin 45 cos 45   −1/ 2 1/ 2 

P’=P.R
1/ 2 1/ 2 
=[4 3]  
 −1/ 2 1/ 2 
 1 3 1 3 
4  2 − 2 4 +
2 
 2
 1 7 
= , 
 2 2

 1 7 
P' =  , 
 2 2

Scaling :- scaling transformation changes the size of an object


X’=x.sx y’=y.sy.
Scaling factor sx scales object in x direction and scaling factor sy scales object in y
direction.
 sx 0 
[x’ y’]=[X Y]  
0 sy 
=P.S
Scale the polygon with coordinates A(2,5), B(7,10) and C(10,2) by two units in X-
direction and two units in y direction.
:- Sx=2 sy=2
 sx 0   2 0 
P' =  = 
 0 sy  0 2

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 32
32
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

 A'   A
B '  =  B  .S
   
 C '
 C 
2 5 4 10
 7 10  2 0   
  0 2  = 14 20 
10 2     20 4 
 
A’ =(4,10) B’=(14,20) C’=(20,4)

Homogenous coordinate system:


In order to combine sequence of transformation we have to eliminate matrix addition
associated with the translation terms in M2. To achieve this we have represent matrix
M1 as 3x3 matrix instead of 2x2. This coordinate system is called as homogenous
coordinate system and it allows us to express all transformation equation as matrix
multiplication.

Homogenous coordinate system for translation:


1 0 0  1 0 0 
 
T = 0 1 0  [x’y’1’]=[x y 1] 0 1 0 
tx ty 1  tx ty 1 
=[x+tx y+ty 1]
For rotation
cos  sin  0 cos  sin  0 
T =  − sin  cos  0  [x’y’1]=[x y 1]  − sin  cos  0  =[xcos-ysin xsin+ycos 1]
 
0 0 1  0 0 1 
For scaling
 sx 0 0 
S = 0 sy 0 
0 0 1 
 sx 0 0 
[X’ y’ 1]=[x y 1] 0 sy 0 
 
0 0 1 
=[x.sx y.sy 1]
Give 3x3 homogenous coordinate transformation matrix for each of the following
translation.
A) shift the image to right by 3 units
B) shift the image up by 2 units.
c) move the image down ½ units and right 1 unit.
d) move the image down 2/3 units and left 4 units.
Homogenous coordinates for translation are:
1 0 0 
T = 0 0 0 
tx ty 1 

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 33
33
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

a) here tx= 3 ty=0


1 0 0 
T = 0 1 0 
3 0 1 
Here tx = 0 ty = 2

1 0 0 
T = 0 1 0 
0 2 1 
C) Here tx=1 ty=-1/2

 
1 0 0
 
T = 0 1 0 
 1 
0 − 1
 2 
d) Here tx=-4 ty=-2/3
 
1 0 0 
 
T = 0 1 0 
 2 
 −4 − 1
 3 
Find transformation matrix that transforms given square ABCD to half its size with
center will still remaining at same position the coordinates of the square are:
A(1 ,1), B(3 ,1) C (3 ,3) D(1 ,3) and center at (2, 2). Also find resultant coordinates of
square.
This transformation is carried out in following steps.
1. Translate square so that its center coincides with origin
2. Scale square with respect to origin,
3. Translate square back to original position.
1 
2 0 0 
1 0 0    1 0 0 

T1.S .T . =  0 1 0    0
1
0   0 1 0 
 2 
 −2 − 2 1  0  2 2 1 
 0 1  
 
1 
 2 +0+0 0+0+0 0 
  1 0 0
 0+ 0 +0 0+ 1 +0 0  0 1 0 
 2 
   2 2 1 
 −2  1 + 0 + 0 0 − 2  1 + 0 1 
 2 2 

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 34
34
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

1 
2 0 0 
  1 0 0
0 1
0  0 1 0 
 2  
 −1  2 2 1 
 − 1 1 
 
1.5 1.5 1
 2.5 1.5 1 

 2.5 2.5 1
 
 1.5 2.5 1
A’= (1.5, 1.5) B’= (2.5,1.5) C’= (2.5,2.5) D’= (1.5 , 2.5
Find transformation of triangle A (1,0), B (0,1) c ( 1, 1) by.
a) rotating 450 about the origin and then translating one unit in x and y direction.
B) translating one unit in x and y direct and then rotating 450 about origin.
The rotation matrix is
cos  sin  0 cos 45 sin 45 0 
R =  − sin  cos  0  =  − sin 45 cos 45 0 
0 0 1  0 0 1 
 1 1 
 2 0 
 2 
 1 1 
− 2 2
0 
 
0 0 1
 
The translation matrix is
1 0 0 1 0 0 
0 1 0 = 0 1 0 
   
tx ty 1  1 1 1 
 1 1 
 2 0 
 2  1 0 0
 1 1  0 1 0
a) R.T =  − 0 
2 2  
  1 1 1 
0 0 1
 

 1/ 2 1/ 2 0 
 
 −1/ 2 1/ 2 0 
=
1 1 1 

 

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 35
35
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

 1 1 
 2 0 
 2 
 A '  A
 B ' =  B   1 1 
    − 2 2
0 
C ' C   
1 1 1 
 

 1 1 
 2 0 
 2 
1 0 0 
 1 
= 0 1 1
1
  − 2 2
0 
1 1 1  
1 1 1 
 

 1 1 
 2 +1 2
+1 1 
 
 1 1 
 − 2 +1 2
+1 1 
 
 1 2 +1 1 
 

 1 1 
 2 0 
 2 
1 0 0
 1 
b)T.R= 0 1 0
1
  − 2 2
0 
1 1 1   
0 0 1 
 

 1 1 
 2 0 
 2 
 1 1 
− 2 2
0 
 
0 2 1
 

 1 1 
 2 0 
 2 
 A '  A
 B ' =  B   1 1 
    − 2 2
0 
C ' C   
0 2 1
 

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 36
36
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

 1 1 
 2 0 
 2 
1 0 1
0 1 1  1 1 
  − 2 2
0 
1 1 1  
0 2 1
 

 1 3 
 1 
 2 2 
 1 3 
− 1 
 2 2 
 2 
 0 1 
 2 
Rotation about an arbitrary point
 To rotate an object about an arbitrary point (xp , yp) we have to carry out 3 steps..
 Translate point (xp , yp)to origin
 Rotate it about origin
 Translate the center of rotation back where it belongs.

Rotation about an arbitrary point step:- translet point (xp,yp) to orogine

(XY,YP)

- Rotation matrix
cos  sin  0
R =  − sin  cos  0 
0 0 1 
Translation matrix to move centre point back to its original position is given as

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 37
37
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

1 0 0
R = 0 1 0
 xp yp 1 
Therefore overall transformation matrix for counter clockwise rotation by an angle
question about point (xp , yp) is given at.
1 0 0 cos  sin  0 1 0 0

T1 .R.T2 = 0 1   
0  − sin  cos  0  0 1 0 
 − xp − yp 1 0 0 1   xp yp 1 

cos  sin  0  1 0 0 

=  − sin  cos  0  0 1 0 
 − xp cos  + yp sin  − xp sin  − yp cos  1  xp yp 1 
cos  sin  0 
=  − sin  cos  0 
 − xp cos  + yp sin  + xp − xp sin  − yp cos  + yp 1 

Perform counter clockwise 450 rotation of triangle A (2 ,3) B (5 ,5) C(4,3) about point
(1,1)
cos  sin  0

T1RT2 = − sin  cos  0 
− xp cos  + yp sin  + xp − xp sin  − yp cos  + yp 1 
=450 Xp=1 Yp=1
cos 45 sin  0

T1RT2 = − sin 45 cos  0 

−1cos 45 + yp sin 45 + 1 − 1.sin 45 − 1.cos 45 + 1 1
 1 1 
 0 
 2 2 
 1 1 
− 0 
 2 2 
 1 1 1 1 
− + +1 − − +1 1
 2 2 2 2 
 1 1 
 2 0 
 2 
 1 1 
− 2 2
0 
 
 2 
 1 − +1 1 
2 

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 38
38
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

 1 1 
 2 0 
2
 A ' 2 3 1   
 B '  = 5 5 1  − 1 1 
0 
    2 2
C '  4 3 1  
1 − 2 +1 1
 
 1 3 
− +1 +1 1
 2 2 
 8 
1 +1 1
 2 
 1 5 
 +1 +1 1
 2 2 
Consider the square A(1 ,0), B (0 , 0), C(0 ,1) and D(1 ,1) rotate the square by 450
anticlockwise direction followed by reflection about x-axis.
cos  sin  0 1 0 0 
T =  − sin  cos  0  0 − 1 0 
 0 0 1  0 0 1
cos  − sin  0
T =  − sin  − cos  0 
0 0 1 
=450
 1 1 
 2 − 2 0
cos 45 − sin 45 0  
 
T =  − sin 45 − cos 45 0  =  −
1 1
− 0
2 2 
0 0 1  
 0 0 1
 

 1 1 
− 0
 A '  1 0 1  2 2
 B '  0  
 = 0 1  1 1 
− − 0
C '   0 1 1  2 2
    
 D ' 1 1 1  0 0 1
 

 1 1 
 2 − 0
 2 
0 0 1
 1 1 
− − 1
 2 2 
 
 0 − 2 1
 1 1   1 1 
A' = 
 2
,− 
2
B ' = ( 0, 0 ) C' = −
 2
,−
2
(
 D ' = 0, − 2 )

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 39
39
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Prove two scaling transformation comments that is S1S2= S2S1


 Sx 0   Sx2 0 
S1 .S2 =  1 
0 sy1  0 sy2 
 Sx .Sx 0 
S1 .S2 =  1 2
0 Sy1 Sy2 
 Sx 0   Sx1 0 
S1.S 2 =  2 
0 sy2  0 sy1 
 Sx .Sx 0 
= 2 1
0 Sy2 Sy1 
Since SX1.SX2=SX2 SX1 and Sy1.Sy2=Sy1.Sy2
S1S2= S2S1
Prove that two 2D rotations about the origin commit that, is R1R2=R2R1
 cos 1 sin 1   cos  2 sin  2 
R1 R2 =   
 − sin 1 cos 1   − sin  2 cos  2 
 cos 1.cos  2 − sin 1 sin  2 cos 1 sin  2 + sin 1 cos  
= 
 − sin 1.cos  2 − sin  2 cos 1 − sin  2 sin 1 + cos 1 cos  
 cos  2 sin  2   cos 1 sin 1 
R2 − R1 =   
 − sin  2 cos  2   − sin 1 cos 1 
 cos  2 cos 1 − sin  2 sin 1 cos  2 sin 1 + sin  2 cos 1 
= 
 − sin  2 cos 1 − cos  2 sin 1 − sin  2 sin 1 + cos 1 cos  2 
cos 1 cos 2 = cos 2 cos 1
sin 2 cos 1 = cos 1 sin 2
Therefore R1R2=R2R1
Prove that successive 2D rotations are additive that is R(1).R(2)=R(1+2)
 cos 1 sin 1   cos  2 sin  2 
R(1 ) =   R( 2 ) = 
 − sin 1 cos 1   − sin  2 cos  2 
 cos 1 sin 1   cos  2 sin  2 
R(1 ) R( 2 ) = 
 − sin 1 cos 1   − sin  cos  2 
 cos 1 cos  2 − sin 1 sin  2 cos 1 sin  2 + sin 1 cos  2 
==  
 − sin 1 cos  2 − cos 1 sin  2 − sin 1 sin  2 + cos 1 cos  2 
= cos 1 cos 2 − sin 1 sin  2 = cos(1 + 2 )
cos 1 sin 2 + sin 1 cos 2 = sin(1 + 2 )
cos(1 +  2 ) sin(1 +  2 ) 
R1 (1 ) R( 2 ) =  
 − sin(1 +  2 ) cos(1 +  2 ) 
cos(1 +  2 ) sin(1 +  2 ) 
R1 (1 +  2 ) =  
 − sin(1 +  2 ) cos(1 +  2 ) 
R1 (1 ) + R( 2 ) = R(1 +  2 )
Reflection and shearing.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 40
40
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Reflection:
A reflection is transformation that produce a mirror image of an objects relative to an
axis of reflection.

Reflection Transformation Original image Reflected image

Reflection about y  −1 0 0 
axis  0 1 0
 
 0 0 1

Reflection about x  1 0 0
axis  0 −1 0 

 0 0 1

Reflection about  − 1 0 0
origin  0 − 1 0
 
 0 0 1 

Reflection about  0 1 0
y=x 1 0 0

 0 0 1 

Reflection about  0 −1 0
y=-x  −1 0 0 

 0 0 1

Shear:
A transformation that slants the shape of an object is called shear transformation there
are two transformation of shear.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 41
41
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

X-shear:
In this x - coordinates are shifted and y coordinates are preserved. It changes x values
which causes vertical lines to tilt right or left.

she object offers, X shear


The transformation matrix for x-shear is given as
1 0 0 
X _ sh =  shx 1 1 
1 0 1
X’=X+shx-y y’=y
Y shear: if preserve the x- coordinates, but changes y values which causes horizontal
lines to transforms into lines which slop up or down.

The transformation matrix for y- shear is given as.


 1 shy 0 
Ysh =  0 0 0  X’=X Y’=Y+ shy. X
Shearing relative to other reference line in X-shear transformation
 0 0 1 we can use y- reference line and in y shear we can use x-reference
line.

 1 0 0

X-shear with y-ref.= Ysh = shx 1 0 

 − shx. yref 0 1 
1 shy 0

Y-shear with X-ref. = 0 1 0

0 − shyxref 1 

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 42
42
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Apply the shearing transformation to square with A (0,0), B(1 ,0), C(1,1), D(0,1) as
given below.
a) shear parameter value of 0.5 relative to line yref = -1
b) shear parameter value of 0.5 relative to line xref=-1
Xsh=0.5 yref=-1
 A'   A 
B '  B   1 0 0
  =   shx  1 0 
C '  C  
     − shx. yref 0 1 
 D '  D 
 −1 0 0 
 0 1 0  1 0 0
 
 0.5 1 0 
1 1 1  
  − 1  − 1 0 1
0 1 1
0 0 1 
1 0 1  1 0 0
  0.5 1 0 
1 1 1  
 1 0 1 
0 1 1
 0.5 0 0
 1.5 0 1 

 2 1 1
 
 1 1 1
b) shy =0.5 and Xref=-1
 A'   A 
B '  B   1 shy 0
 =  0  − xrefshy1 0 
C '  C  
     0 − Xrefshy 0 1 
 D '  D 
 0 0 0
1 1 0
0 1 
0.5
 0 1 0 
 1 1 1 
  0 − 1 −1 1 
 0 1 1 
 1 0.5 0
1 1 1 

1 2 1
 
0 1.5 1 
show how shear transformation may be expressed in terms of rotating and scaling.
Shear transformation matrix for x and y can be given as
1 shy 0 
 shx 1 0 
 
0 0 1 

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 43
43
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Scaling matrix S is given as


 sx 0 0 
0 sy 0
 
0 0 1 
Rotation matrix
cos  sin  0

R =  − sin  cos  0 
0 0 1 
 sx 0 0   R cos  sin  0 
S .R = 0 sy 0   − sin  cos  0 
 
0 0 1  0 0 1 
 sx cos  sx sin  0 
 − sin  sy cos  0 
 
0 0 1 
Comparing shear matrix and S-R matrix we have
Shx=-sysin
Shy=sxsin
Sxcos = sycos =1
1 1
Sx = sy =
cos  cos 
Substituting values of sx and sy we get
1
shx = − sin  = − tan 
cos 
1
Shy= − sin  = tan 
cos 

Shear transformation matrix expressed in terms of rotation and scaling


 1 0 0
 − tan  0 0

 0 tan  1 
Sxcos = sy sin = 1
Substituting values of sx and sy we get
1
shx = − sin  = − tan 
cos 
1
Shy= − sin  = tan 
cos 
Therefore shear transformation matrix expressed in terms of rotation and scale is
 1 tan  0
 − tan  1 0 

 0 0 1
3 Dimensional transformation.
Three dimensional transformation matrix for translation is

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 44
44
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

 1 0 0 0
0 1 0 0 
T= 
0 0 1 0
 
tx ty tz 1
P’=P.T
 1 0 0 0
0 1 0 0 
 X 'Y ' Z '1 =  X Y Z 1 

0 0 1 0
 
tx ty tz 1
[X+TX Y+TY Z+TZ 1]
Scaling:
Three dimensional transformation matrix for scaling is
 sx 0 0 0 
 0 sy 0 0 

0 0 sz 0 
 
0 0 0 1
P’=P.T

 sx 0 0 0
 0 sy 0 0 
 X 'Y ' Z '1 =  X Y Z 1 
0 0 sz 0
 
 0 0 0 1
[X.SX Y.SY Z.SZ 1]

Rotation:
Three dimensional transformation matrix for each coordinate axis rotation is
1. Rotation about X-axis.
1 0 0 0
0 cos  sin  0 
Rx = 
0 − sin  cos  0
 
0 0 0 1
2. rotation about y- axis.
 cos  0 − sin  0 
0 1 0 0 
Ry = 
 sin  0 cos  0
 
0 0 0 1
3. rotation about z-axis.
 cos  sin  0 0 
 − sin  cos  0 0 
Rz = 
0 0 1 0 
 
0 0 0 1 

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 45
45
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Types of projection:
We can project the 3 dimensional object onto the two dimensional view plane there are
two basic ways of projecting objects onto the new plane.
 Parallel projection.
 Perspective projection.

Parallel projection:
In parallel projection, Z coordinate is discarded and parallel lines form each vertex on
the object are extended until they intersect the view plane.

Types of parallel projection:

Parallel projections are basically categorized into two types, depending on relation
between the direction of projection and normal to view plane.
When the direction of projection is normal (perpendicular) to view plane, we have an
orthographic parallel projection.
When the direction of projection is normal (perpendicular) to view plane we have an
oblique parallel projection.
Orthographic parallel projection is subdivided into 2 types
Axonometric orthographic and multi view orthographic projection.
The orthographic projection can display more than one face of an object such on
orthographic projection is called axonometric orthographic projection.

Axonometric projection are of 3 types

1. Isometric:
All 3 principles axes are foreshortened equally
2. Diametric:
Two principle axis are foreshortened equally.
3. Trimetric:
All three principles axis are foreshortened unequally.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 46
46
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 47
47
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Perspective projection:
It produces realistic views. In this the lines of projections are not parallel they all
converge at single point called centre of projection or projection reference point

Types of perspective projection:

The perspective projection of any set of parallel lines that are not parallel to projection
plane converge to vanishing point
The vanishing point for any set of lines that are parallel to one of 3 principle axis of an
object is referred to principle vanishing point.
The perspective projection is classified into 3 types
1. One point projection
2. Two point projection
3. Three point projection

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 48
48
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 49
49
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

4.Withdrawing and clipping:


The process of selecting and viewing the picture with different views is called
windowing.
The process of which divides each element of picture into its visible and invisible
portions, allowing the invisible portion to be discarded is called clipping.

Windowing to viewpoint transformation:


The picture is stored in computer memory using any convenient Cartesian coordinate
system is called as world coordinates system. When picture is displayed on display
device it is measured in physical device coordinate system (PDCS) corresponding to
display device.

Viewing transformation:
The mapping of coordinates from world coordinate system to physical device coordinate
system is called viewing transformation.

Steps of viewing transformation:


1. Converting world coordinates to viewing coordinates.
2. Normalizing viewing coordinates.
3. Converting normalized viewing coordinates to device coordinates.

The steps involved in viewing transformation:


1. Construct the scene in world coordinates using the output primitives and attributes.
2. Obtain a particular orientation for window by setting two dimensional view
coordinates system in world coordinates plane and define a window in viewing
coordinate system.
3. Use viewing coordinates reference frame to provide a method for setting up obituary
orientations for rectangular windows.
4. Once the viewing reference frame established transform description in world
coordinates to viewing coordinates
5. Define view part in normalized coordinates and map the viewing coordinate
description of scene to normalized coordinates.
6. Clip all parts of picture which lie outside the view part

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 50
50
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

MC-
Determine MC Coupon world VC Normalize NYC Convent
would coordinate to viewing normalized
coordinate of viewing coordination viewing
scene using coordination coordinates
modeling to device
coordinate coordination
transformation

2. Dimensional viewing transformation pipeline:

Window:
A world coordinate are selected for display is called window.

View part:
An area on display device to which a window is mapped is called view part.

Window View part


A window is world coordinate are A view part is an area on display
selected for display device to which the window is
mapped.
The window defines what is to be The view part defines where it is to
viewed be displayed.

Types of clipping:
 Line clipping
 Point clipping
 Area clipping
 Curve clipping
 Text clipping.

Line clipping:
Deciding visible portion of line is known as line clipping.
The lines are said to be interior to clipping window and hence visible if both end points
are interior to window.
If both end points of line are exterior to window, the line is not necessarily completely
exterior to window

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 51
51
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

If both the end points are completely to right of, completely to left of completely above,
completely below the window, then the line is completely exterior to window and hence
invisible.

Cohen Sutherland clipping algorithm:


 This algorithm uses a four digit (bit) code to indicate which of nine regions contain
the end points of line.
 The four bit codes are called region codes or out codes.
 Four bit codes for nine regions.
 Consider the clipping window and the lines shown in fig. find the region codes for
each end points and identify whether the line is completely visible, partially visible
or completely invisible.
 If both end points having regions code as 0000 then the line is completely visible. If
both end points does not have region and ending operation is non zero then line is
completely invisible.
 If both end points does not have regions code and ending operation is zero then line
is partially visible.

The intersection with clipping boundaries of windows are given as


Left X L , y = m( X L − X i ) + y1; m  
Right: X R , y = m( X R − X i ) + y1; m  
1
Top: YT , X = (YT − Y1 ) + X 1m  0
m
1
Bottom: YB , X = (YB − Y1 ) + X 1m  0
m
Y −Y
Where m = 2 1
X 2 − X1
Sutherland –Cohen subdivision line clipping algo.
 Read two end points of line say P1(x1 y1) and P2(x2 y2)
 Read two corners (left top and right bottom) of the window, say (Wx1, Wy1) and
(Wx2, Wy2)
 Assign the region codes for two endpoints P1 and P2 using the following steps.
Initialize the bits 0000
Set Bit 1: if (X <wx1)
Set Bit 2: if (X> wx2)
Set bit 3: if (y< wx2)

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 52
52
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Set Bit 4: if (y> wx1)


4. check for visibility of line P1P2
a. if region codes for both endpoints P1 and P2 are zero then line is completely visible.
Hence draw the line and go to step 9.
b. if region codes for endpoints are not zero then the line is completely invisible so reject
the line and go to step 9.
c. if region codes for two endpoints do not satisfy the condition in 4a and 4b the line is
partially visible.
5. Determine the intersecting edge of the clipping window by inspecting the region
codes of two endpoints.
a) if region codes for both the end points are non- zero, find intersection points P1 and
P2
with boundary with boundary edges of clipping window with respect to point P1 and P2
respectively.
b) if region code for any one end points is non zero then find intersection point P1
Or P2 with boundary edge of clipping window with respect to it.
c) Divide the line segments considerably intersection points
7. Reject the line segment if any one end points of it appears outsider ly intersection
points of it appears outsides the clipping window.
8. Draw the remaining line segments
9. Stop.
Use the Cohen- Sutherland out code algo to dip two lines P1 (40,15) P2(75,45) P3 (70, 20)
P4(100,10) against window A (50,10) B (80,10) C (80,40) D (50,40)

Line 1 P1(40,15) P2(75,45)


XL=50 yB=10 XR=80 YT=40

Point End code Ending Position


P1 0101 0000 Partially
P2 1010 Visible.
y − y 45 − 15 30 6
m= 2 1 = = =
x2 − x1 75 − 40 35 7

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 53
53
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

6
= ( 50 − 40 ) + 15
7
6
= (10) + 15
7
= 23.57

1
YT X = (YT − Y1 ) + X 1
m
7
= ( 40 − 15) + 40
6
7
= ( 25 ) + 40
6
= 69.16
y −y 10 − 20 −10 −1
m= 2 1 = = =
x2 − x1 100 − 70 30 3
X R , Y = m( X R − X 1 ) + Y1
−1
= ( 80 − 70 ) + 20
3
1
= (10 ) + 20
3
= 16.66
I 2 = ( 80.16.66 )
Use outside based line clipping method is clip a line starting from (-13, 5) and ending at
(17,11) against the window having its lower left corner at (-8, -4) and upper right corner
at (12, 8).
Point endcode Anding Position
P1 0001 0000 Partially
P2 1010 Visible
y = m ( X L − X 1 ) + y1

= ( −8 − ( −13) ) + 5
1
6 1
Slop of line m = = XL,y 5
30 5 1
= ( −8 + 13) + 5
5
=6
1
yT , X = (YT − Y1 ) + X 1
m
= 5 ( 8 − 5 ) + (−13)
= 5  3 + (−13)
=2

I1 = ( X L , y) = (−8, 6)
I 2 = ( X T , YT ) = (2,8)

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 54
54
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Cyrus- beck line clipping algo:

1. Read two end points of the line say P1 and P2


2 Read vertex coordinates of clipping window
3. Calculate D= P2- P1.
4. Assign boundary point (f) with particular edge.
5. Find inner normal vector for corresponding edge.
6. Calculate D .n and W= P1-f
7. If D .n>0
W .n
TL =
D.n
else
W .n
tu =
D.n
End if
8. Repeat steps 4 through 7 for each edge of clipping window.
9. Find maximum lower limit and minimum upper limit.
10. It maximum lower limit and minimum upper limit do not satisfy condition 0<t<1
then ignore the line.
11. Calculate the intersection points by substituting value of maximum lower limit and
minimum upper limit in parametric equation of line P1 P2
12. Draw line segment P (tL) to P(tu)
13. Stop.
Fig shows the hexagonal clipping window the line P1(-2, 1) to P2(6,3) is to be clipped to
this window. Find intersection points.

D=P2-P1= [6 3] - [-2 1]
= [8 2]
For boundary point f (3,0)
W=P1-f= [-2 1] - [3 0]
= [-5 1]
For the edge V1V2 the inner normal is
N [1 1]
hence D.n=[8 2][1 1]
= [8x1]+2x1]
=[10]

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 55
55
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

The lower limit can be given as


W .n −[−51][11]
TL = =
D.n
−[−5 + 1]
=
10
= +4 /10
4
=
10
Similar calculation with each edge gives the complete result of cyrus –beck algo.
Edge N t w w.n D.n tt tu
V1V2 [1 1] (3,0) [-5 1] -4 10 4/10
V2V3 [1 0] (1, 4) [-3 -3] -3 8 3/8
V3V4 [1 -1] (1,4) [-3 -3] 0 6 0
V4V5 [-1 -1] (5,4) [-7 -3] 10 -10 10/10
V5V6 [-1 0] (5,4) [-7 -3] 7 -8 7/8
V6V7 [-1 1] (3,0) [-5 1] 6 -6 6/6

We have
Maximum lower limit tL=4/10
Minimum upper limit tu=7/8
Substituting these values of t in parametric equation.
P ( 4 /10 ) = P1 + ( P2 − P1 ) .(4 /10)
= [−2 1] + [8 2] (4 /10)
= [−2 1] + [3.2 0.8]
= [1.2 1.8]

P ( 7 / 8 ) = P1 + ( P2 − P1 ) .(7 / 8)
= [−2 1] + [8 2] (7 / 8)
= [−2 1] + [7 1.75]
= [5 2.75]
The intersection points to line P1P2 are [1.2 1.8] and [5 2.75] with edge are [1.2 1.8]
and [5 2.75] with edges V1V2 and V5V6 respectively.

Liang bansky uses parametric equation


X=X1+tx
Y=Y1+ty
Where x=x2-x1
y=y2-y1
The point clipping conditions for liang-Barsley approach in parametric form can be
given as

X w min  x1 + t x  X w max

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 56
56
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Yw min  y1 + t y  Yw max
Liang-barsky express and inequalities with two parameter P and Q as follows.
tpi  qi i = 1, 2,3, 4
Where
P1 = x q1 = x1 − xw min
P2 = x q2 = xco max − x1
P3 = −y q3 = y1 − yw min
P4 = y q4 = yco max − y1

If Line is parallel to left boundary


P1=0
If ‘’ ‘’ ‘’ ‘’ Right ‘’
P2=0
If ‘’ ‘’ ‘’ ‘’ Bottom ‘’
P3=0
If ‘’ ‘’ ‘’ ‘’ top Boundary
P4=0

If qi<0 line is completely outside the boundary and can be eliminated.


If qi0 line is less inside the clipping boundary.
If pi<0 : line proceeds from outside to inside of clipping boundary.
If pi>0 : line proceeds from inside of clipping boundary.
qi
t=
pi
If t1 > t2 line is completely outside the clipping window and it can be rejected.
Otherwise the values of t1 and t2 are substituted in parametric of clipping line.
Algorithm:
1. Read two endpoints of the line say P1(x1,y1) and P2(x2,y2)
2. Read two corners (left top and right bottom) of the window, say (Xwmin, Ywmax,
Xwmax,Ywmin)
3. Calculate the values f parameter pi and qi for i=1, 2, 3, 4 such that
Pi = −x q1 = x1 − xw min
P2 = x q2 = xw max − x1
P3 = −y q3 = y1 − yw min
P4 = y q4 = yw max − y1
4. If Pi=0 then
{
The line is parallel to 1th boundary. Now, if qi<0 then.
{
Line is completely outside the boundary, hence discard the line segment and go to stop.
}
Else

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 57
57
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

{
Check whether the line is horizontal or vertical according ly check the endpoint with
corresponding boundaries.
If line endpoints lie within the bounded area then use them to draw line otherwise use
boundary use boundary coordinates to draw line go to stop.
}
}
5. Initialize values for t1 and t2 as t1=0 and t2=1
6. Calculate values for qi/pi for i=1,2,3,4
7. Select values for qi/pi where Pi>0 and assign minimum out of them as t2
8. Select values of qi/pi where pi>0 and assign minimum out of them t2
9. If (t1<t2)
}
Calculate the endpoints of clipped line as follows
XX 1 = X 1 + t1x
XX 2 = X 1 + t2 x
yy1 = y1 + t1y
yy2 = y1 + t2 y
Draw line (XX1,YY1,XX2, YY2)
}
10. stop
Find clipping coordinates to clip the line segments AB against the windows liang Bars
lay line clipping algo A(20,20), B(80,110) and window coordinates are lower left corner
of windows (40,40) and upper right corner is (100,90)
q1 = X w min
= 20 − 40
X w min = 40 yw min = 40
= −20
X w max = 100 ywax = 90
q2 = X w max − X 1
X 1 = 20 y1 = 20
= 100 − 20 = 80
y2 = 80 y2 = 110
q3 = Y1 − Yw min
P1 = −x = −( x2 − x1 )
= 20 − 40 = −20
= −(80 − 20)
q4 = Yw max − Y
= −60
= 90 − 20
= 70

P2 = x = ( x2 − x1 )
= (110 − 20)
= −90
P4 = y = 90

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 58
58
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

P1 = −60 P2 = 60 P3 − 90 P4 = 90
q1 = −20 q2 = 80 q3 = −20 q4 = 70

qi / pi
qi / pi = −20 / −60 = 0.33
q2 / P2 = 80 / 60 = 1.33
q3 / p3 = −20 / −90 = 0.22
q4 / P4 = 70 / 90 = 0.778
For P < 0 values. That is for P1 and P3
t1 = max(q1 / P1 , q3 / P3 ) = max (0.33, 0.22)t1 = 0.33
for P  0 values that is for P1 andP2
for P  0 values that is for P2 and P4
t2 = min (q2 / P2 , q4 / P4 ) = min(1.33, 0.778)
t2 = 0.778.
t1  t2
XX 1 = X 1 + t1x
= 20 + 0.33(60)
= 40
XX 2 = X 1 + t2 x
= 20 + 0.778(60)
= 66.7
YY1 = Y1 + t1y
= 20 + 0.33(90)
= 50
YY2 = Y1 + t2 y
= 20 + 0.778(90)
= 90
( XX 1 , YY1 , XX 2 , YY2 ) = ( 40,50, 66, 7,90 )

Polygon clipping: -
Wherever a polygon is clipped as collection of line it is known as polygon clipping. After
clipping polygon remain closed.
The polygon can be clipped by processing its boundary as a whole against each window
edge. This is achieved by processing all polygon vertices against each clip rectangle
boundary in term.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 59
59
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Beginning with original set of polygon vertices, we could first clip the polygon vertices,
we would first clip the polygon against the left rectangle boundary to produce a new
sequence of vertices.
The new set of vertices could then be successively passed to right boundary clipper a top
boundary clipper and bottom boundary clipper.
At each step a new set of polygon vertices is generated and passed to the next window
boundary clipper.
There are four possible relationship between edge and clipping boundary or plane.
1. if first vertex of edge is outside window boundary and second vertex of edge is inside.
Then intersection point of is inside. Then intersection point of polygon with window
boundary and second vertex are added to output vertex list.
2. if both vertices of edge are inside the window boundary, only second vertex is called
to output vertex list.
3. if first vertex of edge is inside the window boundary and second vertex is outside,
only edge intersection with the window boundary is added to output list
4. if both vertices of edge are outside the window, nothing is added to output list.
Midpoint subdivision algorithm:
The Sutherland Cohen subdivision line clipping algorithm requires the calculation of
intersection of the line with window edge. This calculations can be avoided by repeated
until we get completely visible and completely invisible line segments.
Midpoints subdivision algorithm:
1. read two endpoints of line say P1(x1, y1) and P2(x2, y2)
2. read two corners (left top and right bottom) of window, say
3. Assign region codes for two end points using following steps:
Initialize code with bits 0000
Set Bit 1 - if (x<wx1)
Set Bit 2 –if (x>wx2)
Set Bit 3 – if (y<wy1)
Set Bit 4 –if (y>wy2)
Check for visibility of line
A) if region codes for endpoints are zero then the line is completely visible. Hence draw
the line and go to step 6
b) If region codes for endpoints are not zero and the logical ANDing of them is also
nonzero then the line is completely invisible, so reject the line and go to step 6
c) if region codes for two endpoints do not satisfy the conditions in (4a) and (4b) the line
is partially visible.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 60
60
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

5) Divide the partially visible line segment in equal parts and repeat step 3 through 5
for both subdivided line segments until you get completely visible and completely in
visible line segment.
6) STOP
Apply the liong- barsky algorithm to line with coordinates (30,60) and (60,25) against
the window.

( X min , Ymin ) = (10,10)and ( X max , Ymax ) = (50,50)

P1 = −x = −(60 − 30) = −30


X 1 = 30 X w min = 10
P2 = −x = (60 − 30) = 30
Y1 = 60 Yw min = 10
P3 = −y = −(25 − 60) = 35
X 2 = 60 X w max = 50
P4 = y = −(25 − 60) = −35
Y2 = 25 Yw min = 50
P1 = −x = −(60 − 30) = −30

q1 = X 1 − X w min = 30 − 10 = 20
q2 = X w max − X 1 = 50 − 30 = 20
q3 = X w max − X 1 = 50 − 30 = 20
q4 = yw min − y1 = 50 − 60 = −10
q1 / p1 = 20 / 30 = 0.667
q2 / p2 = 20 / 30 = 0.667
q3 / p3 = 50 / 35 = 1.4285
q4 / p4 = (−10) / (−35) = 0.2857
forP  0 i.e P1 & P3
t1 = max(−0.667, 0.2857)
t2 = min(0.667, 0.2857)
XX 1 = X 1 + t1x
= 30 + 0.2857 x  30
= 38.571
YY1 = Y1 + t1y
= 60 + 0.2857  −35
= 50
XX 2 = X 1 + t2 x
= 30 + 0.667  30
= 50
YY2 = Y1 + t2 y
= 60 + 0.667  −35
= 36.655

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 61
61
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Sutherland-Hodge polygon clipping algorithm:


 Read coordinates of all vertices of polygon.
 coordinates of clipping window
 consider the left edge of window
 compare the vertices of each edge of polygon, individually with clipping plane.
 save the resulting intersections and vertices in new list of vertices according to four
possible relationships between edge and clipping boundaries. a) if first vertex is
outside and second vertex is inside saved intersection point and second vertex
 If both vertices are inside save only second vertex
 if first vertex is inside and second vertex is outside saved only intersection point.
 if both vertices are outside, save nothing.
 Repeat step 4 and 5 for remaining edges of clipping window. each time resultant list
of vertices is successively passed to process the next edge of clipping window.
STOP
 For a polygon and clipping window shown in fig give the list of vertices after each
boundary clipping.
 Text clipping :In this method either a part of character that is not inside the
windows boundary or characters outside a window boundary are clipped.

Text clipping:
There are 3 different types of methods used for character/text clipping

1. All or name string clipping.


2. All or none character clipping.
3. Text clipping.
1. All or none string clipping:
If all of the string is inside a clip window, we keep it. Otherwise, the string is discarded.
2. All or name character clipping: -
In this method we discard only those characters that are not completely inside the
window.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 62
62
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

5.Introduction to curves
Curve Generation: -
We can use two approaches to draw curved lines.
One approach is to use a curve generation algorithm such as DDA. In this
approach true curve is created.
In second approach the curve is approximated by number of small straight line
segments. This can be achieved with the help of interpolation techniques.
Circular Arc generation using DDA algorithm.
It uses the differential equation of curve which is given as.

(xo,yo) X=RCOSO+XO 1)
X-XO=RCOSO 2)
X = R cos + X …………1.
Y = R sin + Yo ………..2.
Differentiate eg 1 and 2
n

dx = - Rsind ………….. 3
dy = Rcosd …………… 4
x-xo = Rcos ………….. 5
y-yo = Rsin …………. 6
put 5 & 6 in eg 3 and 4
n

dx = - (Y-Yo) d
dy = (x-x2) d
The values of dx & dy indicate the increment in x & y increment respectively.
Next point on are can be calculated as
x2 = x1 + dx = x1 - (y1-yo) d
y2= y1+dy = y1 + (x2– xo) d
d = min (o.o1, 1/ (3.2* (1x-xo1 + 1y-yo1))
Algorithm:
1. Read the center of curvature say (X0 , Y0)
2. Read the arc angle, say .
3. Read the starting point of arc(x,y)
4. calculate d
d=min(0.01,1/(3.2*(1x-x01+1y-y0)))
initialize Angle = 0.
6. while (Angle<)

do
{ plot (x,y)
X=X-(y-y0)*d
Y=y+(x-x0)*d
Angle= Angle + d7. Stop.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 63
63
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Problems in true curve generation approach :-

1. To specify a curve, we need more information than its end points.


2. It is difficult to apply transformations for example, a circle when scaled in only one
direction becomes an ellipse.
3. New clipping algorithm is required to dip arcs.
4. This algorithm is required to clip arcs circular or elliptical such as airplane wings or
cars or human faces are complex.

Interpolation:
To deal with same complex curves for which no direct mathematical function is
available. Such curves can be drawn using approximation methods.
If we have set of sample points which lie on the required curve, then we can draw the
required curve by filling portion of curve with the pieces of known curves which pass
through nearby sample points. The gap between sample points can be filled by finding
the coordinates of points along the known approximately curve and connecting these
points with line segments.
The main task in this process is to find the suitable mathematical expression for known
curve. There are polynomial, trigonometric, exponential and other classes of functions
that can be used to approximate the curve
X=fx(u)
Y=fy(u)
Z=fz(u)

We will construct the function as the sum of terms, one terms, one term for sample
point. These functions can be given as,
𝑛
fx(u)= ∑𝑖=1 𝑥𝑖 𝐵𝑖 (𝑢)
n
fy(u)=  y B (u)
i =1
i i

n
fz(u)=  z B (u)
i =1
i i

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 64
64
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

The function Bi (u) is called blending function.


Interpolating algorithm; -
 Get the sample points.
 Get intermediate values of u determine intermediate points.
 Calculate blending function values for middle section of curve.
 Calculate blending function values for first section of curve.
 Calculate blending function values for last section of curve.
 Multiply the sample points by blending functions to give points on approximation
curve.
 Connect the neighboring points using straight line segments.
 Stop.
Types of curves:
 Hilbert’s curve
 kotch curve
 Bezier curve
 B-spline curve.

Hilbert’s curve: -
Can be constructed by following successive approximations. if a square is divided into
four quadrants. we can draw first approximation to Hilbert curve by connecting Centre
point of each quadrant.
The second approximation to Hilbert’s curve can be drawn by further subdividing each
of the quadrant and connecting their centers before moving to next major quadrant
The third approximation subdivides quadrant again. We can draw third approximation
to Hilbert’s curve by connecting the Centre of finest level of quadrants. Before stepping
to next level of quadrants.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 65
65
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Koch curve:
Koch curve can be drawn by dividing line into 4 equal segments with scaling factor 1/3
and middle two segments are so adjusted that they form adjacent sides of an equilateral
triangle as shown in figure.

For Approximation of Koch cune


To apply the second approximation to Koch curve we have to repeat the above process
for each of four segments the resultant curve is as shown in figure.

Approximation of Koch cune


The resultant curve has more wiggles and its length is 16/9 times the original length.
Each repetition increases the length of curve by factor 4/3
Length of curve is infinite.
It doesn’t deviate much from its original shape.

Bezier curves: -
It is determined by defining polygon.
They are easy to implement. Bezier curve section can be fitted to any number of control
points. As number of control points increases, the degree of Bezier polynomial also
increases. Three control points generate parabola, 4 control points generate cubic curve
and so on.

1. curne with 3 c 2. curne with 4


control points Waves with 5 control
points

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 66
66
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

Bernstein polynomials:
The Bezier blending functions BEZ k, n (u)
are the Bernstein polynomial. They are
specified as
BEZ k,,n =(cn,k) uk (1-u)n-k
Where ((n,k) are binomial coefficients.
n!
C (n,k) =
k !(n − k )!
The position vector represents a set of 3
parametric equations for individual curve coordinates.
n
X (u) = X
k =0
k BEZ k ,n (u )
n
Y (u) =  y BEZ
k =0
k k ,n (u )
n
Z (u) =  Z BEZ
k =0
k k ,n (u)

Properties of Bezier curve: -

 The basic functions are real.


 Bezier curve always passes through the first and last control points.
 The degree of polynomial defining the curve segment is one less than the number of
defining polygon point.
 Curve follows shape of defining polygon.
 The curve lies entirely within the convex hull formed by and control points.
 The curve is invariant under an office transformation.
The Bezier matrix for periodic cubic polynomial is

P(u)=(1-u)3 P1+3u(1-u)2 P2+3u(1-u)2P2+3u2(1-u)P3+u3P4

Midpoint approach:
 In this approach Bezier curve can be constructed simply by taking midpoints
 In these midpoints of lines connecting 4 control points (A B C D) are determined
(AB, BC, CD)
 These midpoints are connected by lines segments and their midpoints ABC and BCD
are determined.0
 Finally, these two midpoints ABCD is determined.

Algorithm.
 get four control. Points say A (XA, YA), B (XB, YB), C (Xc, Yc ), D(X0Y0)
 Divide the curve presented by points A, B, C, D in two sections.

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 67
67
All the BEST ☺ Computer Graphics(CGR)
(3rd Sem - CO/CM)

XAB=(XA+XB)/2
YAB=(YA+YB)/2
XBC=(XB+XC)/2
YBC=(YB+YC)/2
XCD=(XC+XD)/2
YCD=(YC+YD)/2
XABC=(XAB+XBC)/2
YABC =( YAB+YBC)/2
YBCD=(XBC+XCD)/2
YBCD=(YBC+YCD)/2
XABCD=(XABC+XBCD)/2
YABCD= (XABC+XBCD)/2
3. Repeat the step 2 for section A, AB, ABC ABCD and section ABCD, BCD, CD, D.
4. Repeat step 3 until we have sections so short they can be replaced by straight lines
5. Replace small sections by straight lines
6. Stop.

B-spline:
 The Bezier curve produced by Bernstein basis function has limited flexibility.
 The second limiting characteristics is that the value of blending function is nonzero
for all parameter values over entire curve.
 Another basis function called B-spline bans.
 It is non global because each vertex Bi is associated with unique basis function.
 Each vertex affects the shape of curve only over the range of parameter values
where its associated basis function is nonzero.
 It allows the order of the basis function hence degree of resulting curve is
independent of number of vertices.
 The position vector is given by
n +1
P(u ) =  BiNik (u)U min  u  umax , 2 
i =1
(𝑢−𝑥1 )𝑁𝑖,𝐾−1 (𝑢) (𝑥𝑖+1 −𝑢)𝑁𝑖+1,𝐾−1(𝑢)
𝑁𝑖𝐾(𝑢) = 𝑋𝑖+𝐾−1 −𝑋𝑖
+ 𝑋𝑖+𝑘 −𝑋𝑖+1

GANESH ACADEMY OF ENGINEERING


New Panvel- 9699991140 | Kharghar- 9702111140 | Nerul- 9702111140 68
68

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy