0% found this document useful (0 votes)
108 views32 pages

Computer Graphics Final-1

Here are the key differences between random scan and raster scan displays: Random Scan: - Uses an electron beam like a pencil to draw individual lines on the screen - Restricted to line drawing applications only - More expensive than raster scan - Easy to modify drawings as it draws individual lines - Can display solid patterns easily Raster Scan: - Divides the screen into a grid of pixels arranged in rows and columns - Controls the intensity of each pixel to form an image - Suitable for realistic images and photos not just lines - Less expensive than random scan - Modifying an image is more difficult as it deals with individual pixels - Scans the beam across the screen left to right

Uploaded by

Semakula Calvin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views32 pages

Computer Graphics Final-1

Here are the key differences between random scan and raster scan displays: Random Scan: - Uses an electron beam like a pencil to draw individual lines on the screen - Restricted to line drawing applications only - More expensive than raster scan - Easy to modify drawings as it draws individual lines - Can display solid patterns easily Raster Scan: - Divides the screen into a grid of pixels arranged in rows and columns - Controls the intensity of each pixel to form an image - Suitable for realistic images and photos not just lines - Less expensive than random scan - Modifying an image is more difficult as it deals with individual pixels - Scans the beam across the screen left to right

Uploaded by

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

NDEJJE UNIVERSITY - KAMPALA CAMPUS

FACULTY OF BASIC SCIENCES AND INFORMATION


TECHNOLOGY
COMPUTER GRAPHICS
COURSEWORK GROUP TWO

GROUP MEMBERS COMPUTER


GRAPHICS
NAMES COURSE REGSTRATION NUMBER
NAMPEWO DORAH BIT 19/2/314/D/906
SSEMAKULA CALVIN BIT 19/2/314/D/133
WEKESA DERRICK BIT 19/2/314/E/144
MUKISA JONATHAN BIT 19/2/314/E/1245
NAMWIRYA DAPHINE BIT 19/2/314/D/1216
KEZALA ANTHONY BIT
IGNATIUS
QUESTION 3

a) i)

State the distance formula

The distance formula in coordinate geometric is used to

calculate the distance between two given points

The distance formula to calculate the distance between two points

(x1,y1)(x1,y1),and (x2,y2)(x2,y2) is given as = D =

(𝑥𝑥2 −𝑥𝑥1) 2 + (𝑦𝑦2 −𝑦𝑦1) 2 𝐷𝐷 = (𝑥𝑥2 −𝑥𝑥1) 2 + (𝑦𝑦2


−𝑦𝑦1)

D= (𝑥𝑥2 −𝑥𝑥1) 2 +(y2-y1)2


P

Distance Formular = (𝑥𝑥2 −𝑥𝑥1) 2 +(y2-y1)2


P

Find the distance between the points (-2,-3) and (-4,4)

(-2,-3) & (-4,4)

Therefore; x1 = -2 and x2 = -4 , y1= -3 and y2= 4

Distance = (−2 −−4) 2 +(-3-4)2


P

= 7.28 units
a) ii) find the radius of a circle given that the center is at (2,-3) and the points (-1,-2) lies on the

circle the distance between center and the points lies on the circle will equal to radius of the

circle so using distance formular

Distance = (2 + −1) 2 +(-3+-2)2


P

= (1) 2 +(-5)2
P

No. 3b)

Four points (4,y) and (-2,-1) distance = 10 units

Distance = (𝑥𝑥2 −𝑥𝑥1) 2 +(y2-y1)2


P

(10)2 = ((−2 − 4) 2 +(-1-y)2 Square


P

both sides

102 = (-2-4)2 + (-1-y)2

100 = (-6)2 + (-1-y)2

100 = 36 + (-1-y)2

Applying the square roots

-1-y = -+ 8

-y = 1 -+8

-y = -7
Divide by -1 both sides

Y=7

No 3c)

The distance between two points in 3D

P(x,y,z) and Q(x2,y2,z2)

PQ = (𝑥𝑥2 −𝑥𝑥1) 2 +(y2-y1)2 + (z2-z1)2 Distance


P

between 2 points formula

P(x1,y1,z1) and Q(x2,y2,z2)

By using a box

PQ2 = PA2 + AQ2 --------(1)


Also rectangle ANQ, <ANQ is a right angle similary applying the pythogrous theorem in ANQ we
get AQ2 =AN2 + NQ2 ------(2)

From equation 1 and 2 we have

PQ2 = PA2 + NQ2 + AN2

As coordinates of the pointer, p and q as shown

PA = y2-y1

AN = x2-x1 and NQ =z2-z1 therefore PQ2 = (x2-x1)2 + (y2-y1)2

So now we find the distance between two points

P(x1,y1,z1) and Q(x2,y2,z2) in the dimensions

Distance of any points Q(x,y,z) in space from origin is given by;


OQ = √𝑥𝑥 2
P +y2 + z2

No.

Solution

Let the required points be P(x,y,z)

Coordinates of the points A,B and C are given as ( 0,0,0) , (0,b,0) , (0,0,t) and (0,0,0)

As we know the points p is equidistants from the given points

Hence PA = PB=PC=PO

Now applying the distance formula for PO=PA, we get

P
2
+y
x2 + y2 + z2 = (a-x)2 + y2 +z x2 = (a-x)2 x= a/2 similarly applying the distance formula for PO =

PB and PO=PC we get y=b/2 and z=c/2 therefore coordinates of the points which are equivalent

from the points A,B,C and O is given by (a/2,b/2,c/2)

No 3d)

Find the midpoints of line m when coordinates (3,3)

M = (xm,ym)

M = (x1+x2)/2 , (y1+y2)/2

M = -1/2 , -4/2

M = (-1/2 , -7)

M(-1,1) and C(1,-3)

Midpoints solution
M = (Xm, Ym)

M=(x1+x2/2, y1+y2/2)

M= ((-1+1)/2 ,(1+-3)/2)

M= (0/2 , -2/2)
M = (0,1)

No. 3e)

A ray is a set of straight lines passing through a point

Scaling is the changing of the size of something forexample a toy car to a scale model of a life size
car.

Uniform scaling

This is a type where everything that is scaled is scaled by the same amount.

Forexample

If length of the scaled model is half the length of the real world objects the width of the scaled model
will also be half the width of the real world objects.

Non – Uniform Scaling

In this type the scaling factor doesn’t remain the same, can change when going from one dimension
to another your dimensions are you different measurements forexample your length, your width
and your height. Every dimensional object has three basic measurements.

Calculating the magnitude

V=(x,y,z) v= (𝑥𝑥 2 +y2 + z2


P
+16 + 64

Question 6

a) What is a graphics display? Discuss the parts of Display Processor. Use a diagram to illustrate the
parts.

b) What is a CRT? What are the parts of a CRT? Use a diagram to illustrate the parts of a CRT.

c) Differentiate between Random Scan and Raster Scan Display. What are the pros and cons of a
random scan display? Illustrate a raster scan display. Discuss the two types of Scanning or
travelling of beam in Raster Scan. Discuss the pros and cons of raster scan display

c) Discuss the two popular approaches for producing colour displays with a CRT. Provide a detailed
description on the following:

(i) Direct View Storage Tubes,

(ii) Flat Panel Display,

(iii) Plasma Panel Display,

(iv) LED (Light Emitting Diode),

(iv) LCD (Liquid Crystal Display).

Differentiate between emissive and none missive displays.

d) What are input devices? Discuss the various key input devices. Explain the layout of a keyboard.
Discuss: (i) flatbed scanner, (ii) handheld scanner. Explain how printers can be classified. Use an
illustration to support your answer.

e) Explain the following: interpolation, jaggies, layer, palletized texture, refresh rate, rendering,
texture antialiasing, texture filt
a)
Graphics display is the way in which line drawings and text are displayed. The display device is
an output device used to represent the information in the form of images or in visual form the
Display systems are mostly called a video monitor or Video display unit (VDU).

Discuss the parts of Display Processor. Use a diagram to illustrate the parts.
Display processor is a part of hardware or interpreter which is used to transform display
processor code into pictures. It is used to convert digital information from CPU to analog data.It
is a digital-analog conversion which depends on the types of devices and graphics functions. The
main function of display processors is called scan conversion.

In this process, contiguous graphics objects have to be separated as collections of ellipse,


rectangles, and polygons.

The display processor is also sometimes called a display processing unit (DPU). Parts
of Display Processor have the following four parts:
Display Generator
Display Console
Display Controller
Display File Memory

BLOCK OF THE DIAGRAM


Display Controller
It is also called the Video controller. It is used to control the operations of the display device. Its
functions are as follows:
It is used to handle the interrupt.
It is used to interpret the instructions.
It is also used to manage time.
Display File Memory
It is used to create an image. It is also used for visual object recognition.
Display Generator
It is used to produce the character. It is also used to create curves.
Display Console
It consists of a CRT, Light pen, keyboard, and Deflection system.

b)
A cathode-ray tube (CRT) is a specialized vacuum tube in which images are produced when an
electron beam strikes a phosphorescent surface. Most desktop computer displays make use of
CRTs. The CRT in a computer display is similar to the "picture tube" in a television receiver.

Parts of a CRT
Components of CRT
Electron Gun
Electron gun consisting of a series of elements, primarily a heating filament (heater) and a
cathode. The electron gun creates a source of electrons which are focused into a narrow beam
directed at the face of the CRT.
Control Electrode
It is used to turn the electron beam on and off.
Focusing system
It is used to create a clear picture by focusing the electrons into a narrow beam.
Deflection Yoke
It is used to control the direction of the electron beam. It creates an electric or magnetic field
which will bend the electron beam as it passes through the area. In a conventional CRT, the yoke
is linked to a sweep or scan generator. The deflection yoke which is connected to the sweep
generator creates a fluctuating electric or magnetic potential. Phosphorus-coated screen
The inside front surface of every CRT is coated with phosphors. Phosphors glow when a
highenergy electron beam hits them. Phosphorescence is the term used to characterize the light
given off by a phosphor after it has been exposed to an electron beam.
Use a diagram to illustrate the parts of a CRT.
CRT stands for Cathode Ray Tube. CRT is a technology used in traditional computer monitors
and televisions. The image on CRT display is created by firing electrons from the back of the tube
of phosphorus located towards the front of the screen.
Once the electron heats the phosphorus, they light up, and they are projected on a screen. The
colour you view on the screen is produced by a blend of red, blue and green light.

C)
Differentiate between Random Scan and Raster Scan Display.
Random Scan System uses an electron beam which operates like a pencil to create a line image on
the CRT screen. While A Raster Scan Display is based on intensity control of pixels in the form
of a rectangular box called Raster on the screen.
Random Scan Raster Scan
It is restricted to line drawing applications It is suitable for realistic display
It is more expensive It is less expensive
Any modification if needed is easy Modification is tough
Solid pattern is tough to fill Solid pattern is easy to fill
Refresh rate depends or resolution Refresh rate does not depend on the picture.
Only screen with view on an area is displayed. Whole screen is scanned.
Beam Penetration technology come under it. Shadow mark technology came under this.
It does not use interlacing method. It uses interlacing
It has high Resolution Its resolution is low.

What are the pros and cons of a random scan display?


Pros (Advantages)
Higher resolutions as compared to raster scan display.
Produces smooth line drawing.
Produce smooth line drawings.
High Resolution
Less Memory required.
A CRT has the electron beam directed only to the parts of the screen where an image is to be
drawn.
Cons (Disadvantages)
Random-Scan monitors cannot display realistic shades scenes.
Realistic images with different shades cannot be drawn.
Colour limitations.

Illustrate a raster scan display.


Raster-Scan display processor
An important function of display process is to digitize a picture definition given in an application
program into a set of pixel-intensity values for storage in refresh buffer. This process is referred
to as scan conversion. The purpose of display processors is to relieve the CPU from graphics jobs.
Display processors can perform various other tasks like: creating different line styles, displaying
colour areas, etc. Typically display processors are utilized to interface input devices, such as
mouse, joysticks.

Disadvantages
Data about the intensities of all pixels has to be stored.
Resolution is lower than random scan display.
More memory is required.

Advantages
Colour range available is bigger than random scan display.
Real life images with different shades can be displayed.

Discuss the two types of Scanning or travelling of beam in Raster Scan.


Types of Scanning or travelling of beam in Raster Scan
Interlaced Scanning
In Interlaced scanning, each horizontal line of the screen is traced from top to bottom. Due to
which fading of display of object may occur. This problem can be solved by non-Interlaced
scanning. In this first of all odd numbered lines are traced or visited by an electron beam, then in
the next circle, even number of lines are located.
Non-Interlaced Scanning
For non-interlaced display refresh rate of 30 frames per second used. But it gives flickers. For
interlaced display refresh rate of 60 frames per second is used.

Discuss the pros and cons of raster scan display


Pros
Allows solids, not just wireframes
Leverages low-cost CRT technology for example televisions
Bright that is to say display emits light
Cons
Requires screen-size memory array
Discreet sampling or pixels that is to say the lines are not straight anymore as in random scan
display device. The lines now consist of pixels that may lead to jig jag Practical limit on size
(call it 40 inches)
Finicky

C)
Discuss the two popular approaches for producing colour displays with a CRT.
The CRT Monitor display by using a combination of phosphors. The phosphors are different
colours. There are two popular approaches for producing colour displays with a CRT are:
i) Beam Penetration Method ii)
Shadow-Mask Method
Beam Penetration Method

The Beam-Penetration method has been used with random-scan monitors. In this method, the
CRT screen is coated with two layers of phosphor, red and green and the displayed colour
depends on how far the electron beam penetrates the phosphor layers. This method produces four
colours only, red, green, orange and yellow. A beam of slow electrons excites the outer red layer
only; hence screen shows red colours only. A beam of high-speed electrons excites the inner
green layer. Thus screen shows a green colour

Shadow-Mask Method
Shadow Mask Method is commonly used in Raster-Scan System because they produce a much
wider range of colours than the beam-penetration method.
It is used in the majority of colours TV sets and monitors.
Construction
A shadow mask CRT has 3 phosphor colours dots at each pixel position. One
phosphor dot emits red light
Another emit green light
Third emit blue light
This type of CRT has 3 electron guns, one for each colours dot and a shadow mask grid just
behind the phosphor coated screen.

Provide a detailed description on the following


i) Direct View Storage Tubes
Direct View Storage Tube (DVST) resembles CRT as it uses electron gun to draw picture and
phosphor coated screen to display it. The phosphor used in this is of high persistence. DVST
does not use refresh buffer or frame buffer to store picture definition. Picture definition is stored
in inside CRT in form positive charged distribution. Because of this reason DVST is knows as
Storage Type CRT. In DVST no refreshing is required as result picture drawn on DVST will be
seen for several minutes before fading.

ii) Flat Panel Display


The Flat-Panel display refers to a class of video devices that have reduced volume, weight and
power requirement compare to CRT.
For example: Small T.V. monitor, calculator, pocket video games, laptop computers, an
advertisement board in elevator.

iii) Plasma Panel Display


A plasma display is a computer video display in which each pixel on the screen is illuminated by
a tiny bit of plasma or charged gas, somewhat like a tiny neon light. Plasma displays are thinner
than cathode ray tube displays and brighter than liquid crystal displays (Light Emitting Diode)

iv) Light Emitting Diode (LED)


Remote controls generate invisible light. A Light emitting diodes (LED) is an optical electrical
energy into light energy when voltage is applied. In forward biased, energy is released in the
form of light when free electrons in conduction band recombine with holes in the valence band.

v) LCD (Liquid Crystal Display).


A liquid-crystal display (LCD) is a flat-panel display or other electronically modulated optical
device that uses the light-modulating properties of liquid crystals combined with polarizers.
Liquid crystals do not emit light directly, instead using a backlight or reflector to produce images
in colours or monochrome.
Differentiate between emissive and none emissive displays. Emissive
displays
Emissive displays are devices that convert electrical energy into light; where the image is
produced directly on the screen.
Examples for emissive displays are: Light Emitting Diode (LED), Vacuum Fluorescent Display
(VFD) and Plasma Display Panel (PDP).
Non-Emissive displays
Non-emissive displays use optical effects to convert sunlight into graphical patterns and shapes;
where the light is produced behind the screen and the image is formed by filtering this light.
An example for non-emissive displays is: Liquid Crystal Display (LCD).
d) What
are input devices?
An Input device is the piece of computer hardware equipment used to give input to the computer.
The input can be in the form of graphics, text, sound, audio, video, and image. Input devices
are also those devices through which we can give the data and instructions to the computer.

Discuss the various key input devices.


These Devices include:
Keyboard
The most commonly used input device is a keyboard. The data is entered by pressing the set of
keys. All keys are labelled. A keyboard with 101 keys is called a QWERTY keyboard.
Mouse
A Mouse is a pointing device and used to position the pointer on the screen. It is a small palm
size box. There are two or three depression switches on the top.
Trackball
It is a pointing device. It is similar to a mouse. This is mainly used in notebook or laptop
computer, instead of a mouse. This is a ball which is half inserted, and by changing fingers on
the ball, the pointer can be moved.
Space ball
It is similar to trackball, but it can move in six directions where trackball can move in two
directions only. The movement is recorded by the strain gauge. Strain gauge is applied with
pressure. It can be pushed and pulled in various directions. The ball has a diameter around 7.5
cm. The ball is mounted in the base using rollers. One-third of the ball is an inside box, the rest is
outside. Joystick
Joystick is also a pointing device which is used to change cursor position on a monitor screen. It
is also a stick having a spherical ball as it’s both lower and upper ends as shown in fig. The lower
spherical ball moves in a socket. The joystick can be changed in all four directions. The function
of a joystick is similar to that of the mouse. It is mainly used in Computer Aided Designing and
playing computer games.

Light Pen
Light Pen (similar to the pen) is a pointing device which is used to select a displayed menu item
or draw pictures on the monitor screen. It consists of a photocell and an optical system placed in
a small tube. When its tip is moved over the monitor screen, and pen button is pressed, its
photocell sensing element detects the screen location and sends the corresponding signals to the
CPU.

Explain the layout of a keyboard.


A keyboard is one of the primary input devices that allow users to input text into a computer or
any other electronic machinery. It is a peripheral device that is the most basic way for the user to
communicate with a computer. It consists of multiple buttons, which create numbers, symbols,
and letters, and special keys like the Windows and Alt key, including performing other functions.
The design of the keyboard comes from the typewriter keyboards, and numbers and letters are
arranged on the keyboard in that way, which helps to type quickly.
The above keyboard design is called QWERTY design because of its first six letters across in the
upper-left-hand corner of the keyboard. Although the keyboard design is derived from the
typewrites, nowadays, it also includes many other keys as well as Alt/Option, Control, and
Windows key can be used as shortcuts to perform the particular operation by combination with
other keys. For example, if you press Control (Ctrl) + S while working on a document in
Microsoft Word, it will save the document you are working on. Furthermore, most of the
keyboards have function keys (F1 to F12 or F16) at the top of the keyboard and arranged arrow
keys in the downside used to perform numerous functions

Discuss
a) flatbed scanner,
Flat Bed Scanner: It resembles a photocopy machine. It has a glass top on its top. Glass top in
further covered using a lid. The document to be scanned is kept on glass plate. The light is passed
underneath side of glass plate. The light is moved left to right. The scanning is done the line by
line. The process is repeated until the complete line is scanned. Within 20-25 seconds a
document of 4" * 6" can be scanned.
b) Hand Held Scanner
It has a number of LED's (Light Emitting Diodes) the LED's are arranged in the small case. It
is called a Hand held Scanner because it can be kept in hand which performs scanning. For
scanning the scanner is moved over document from the top towards the bottom. Its light is
on, while we move it on document. It is dragged very slowly over document. If dragging of
the scanner over the document is not proper, the conversion will not correct.

Explain how printers can be classified. Use an illustration to support your answer. Printers
are classified as
Impact printer
Non-Impact printer
Classification of printers is shown in the image below:
Impact Printer
Impact printer strikes a head or a needle against an ink ribbon to make a mark on the paper.
Impact printer may be three types:
(a) Daisy Wheel Printer,
(b) Drum Printer, and (c)
Dot Matrix Printer.

Daisy Wheel Printers


It is used to print one character at a time.
The head of this printer resembles daisy flower, with the printing arms that appear like the petals
of a flower and thus its named as daisy printer.
It can be used to print professional letter quality documents. It also known letter quality printer as
the print quality is better as a high-quality typewriter. It gives high resolution output.

Its reliability is higher than that of dot matrix printer. It can have speed upto 90 cps.
The time required to rotating the print wheel for each character desired, that’s a reason it is slow
in use. So these printers are slower and expensive than dot matrix printers.

Drum Printers
It is print a single line at a time.
Its printing speed varies from 150 lines to 2500 lines in a minute with 96 to 106 characters on a
15 inch line.
Line printers are designed for heavy printing applications. These printers are faster than character
type printers.
These types of printers produce lot of noise.

Dot Matrix Printers


Dot Matrix printing technology is very old. It can print one character at a time. It can print any
shapes of character, special characters, graphs and charts which user wishes to print.
This printer’s speed can be measured by Character per second (cps). The speed can vary from
about 200 to 500 cps.
The print quality is determined by the number of pins, which can be varying from 9 to 24. For the
higher print resolution, more pins per inch are given.

Non-Impact Printer
Non-impact printers does not use striking device to produce characters on the paper. These types
of printers spray ink on papers through nozzles to form characters and patterns.
Non-Impact printer may be of two types:
(a) Daisy Wheel Printer, and
(b) Drum Printer Inkjet Printers
Inkjet printers are generally used for home purposes. It is a printer that place extremely small
droplets of ink onto paper to create an image.
Its cost is relatively higher than dot matrix printers but the quality is better.
These kinds of printers produce high quality prints and graphics due to its high-resolution
feature.

Laser Printers
Laser printer produces high quality text and images for personal computers.
Laser printer is also known as page printer because they process and store the entire page before
printing it.
They don’t produce noise and print faster. Thus they are also preferred to print large amount of
contents on large volume of papers.

e)
Explain the following
Interpolation
Is a method of constructing new data points within range of discrete set of known data points the
number of data points obtained by sampling or experimentation represents values of function for
limited number of values of independent variable. Jaggies
Jaggies is the slang term for the blurry jagged lines that can appear in computer graphics. They
typically occur in raster, also known as bitmap, images with decreased resolution. The lines
resemble stairsteps and appear in place of straight lines or curves at the edges of the image Layer
In graphics software, layers are the different levels at which one can place an object or image
file. In the program, layers can be stacked, merged, or defined when creating a digital image.

Palletized texture
In computer graphics, a palette, also called colours lookup table (CLUT), is a correspondence
table in which selected colours from a certain colours space's colours reproduction range are
assigned an index, by which they can be referenced. By referencing the colours via an index,
which takes less information than the one needed to describe the actual colour in said colours
space, this technique aims to reduce data usage, be it as processing payload, transfer bandwidth,
RAM usage or persistent storage. Images in which colours are indicated by references to a CLUT
are called indexed colours image refresh rate, the refresh rate of your display refers to how many
times per second the display is able to draw a new image. This is measured in Hertz (Hz). For
example, if your display has a refresh rate of 144Hz, it is refreshing the image 144 times per
second.
Rendering
Rendering or image synthesis is the process of generating a photorealistic or non-photorealistic
image from a 2D or 3D model by means of a computer program. The resulting image is
referred to as the render. Texture antialiasing
In digital signal processing, anti-aliasing is the technique of minimizing aliasing (jagged or
blocky patterns) when representing a high-resolution signal at a lower resolution. In most cases,
anti-aliasing means removing data at too high a frequency to represent. Texture filtering
Texture filtering is a technique in the field of computer graphics where engineers utilize pixel
maps to fill in a particular graphic area. It commonly uses something called “Texel’s” –
individual picture pixels in a larger texture map.

QUESTION FOUR
MATRICES
Introduction

The usefulness of a matrix in computer graphics is its ability to convert geometric


data into different coordinate systems. A matrix is composed of elements
arranged in rows and columns. In simple terms, the elements of a matrix are
coefficients that represents the scale or rotation a vector will undergo during a
transformation.

Matrix

A matrix is an entity composed of components arranged in rows and columns.


Mathematically, a matrix is represented as:

The rows and columns of a matrix determines the dimension of a matrix. A matrix
containing 2 rows and 3 columns is of dimension 2x3. Here is an example of
matrices with different dimensions:

Dimensions in matrix arithmetic is very important, since some operations are not
possible unless matrices have identical dimensions. Matrices can be added and
subtracted. They can be multiplied by a scalar and multiplied among themselves.
Matrices can not be divided, instead a matrix called the Inverse is calculated
which serves as the reciprocal of the matrix. Matrices have an arrangement
property. They can be arranged in row-major format or column-major format.
This is very important to keep in mind since multiplying vectors or matrices of
wrong format will result in wrong calculations. OpenGL requires all matrices to be
in column-major format

Identity Matrix

The Identity Matrix is a special kind of matrix which is similar to the concept of “1” in
real numbers. Just like a real number multiplied by “1” results in the real number
itself, any matrix multiply by the identity matrix results in the matrix itself. The
Identity matrix is defined as:
Multiplying any matrix by the identity matrix results in the same matrix.

TYPES OF MATRICES.

Types of Matrices

Different types of Matrices and their forms are used for solving numerous problems.
Some of them are as follows:

1) Row Matrix

A row matrix has only one row but any number of columns. A matrix is said to be a row
matrix if it has only one row. For example,
2) Column Matrix

A column matrix has only one column but any number of rows. A matrix is said to be a
column matrix if it has only one column. For example,
3) Square Matrix

A square matrix has the number of columns equal to the number of rows. A matrix in
which the number of rows is equal to the number of columns is said to be a square
matrix. Thus an m × n matrix is said to be a square matrix if m = n and is known as a
square matrix of order ‘n’. For example,

4) Rectangular Matrix

A matrix is said to be a rectangular matrix if the number of rows is not equal to the
number of columns. For example,

5) Diagonal matrix

A square matrix B = [bij] m × m is said to be a diagonal matrix if all its non-diagonal


elements are zero, that is a matrix B =[bij]m×m is said to be a diagonal matrix if bij = 0,
when i ≠ j. For example,

6) Scalar Matrix

A diagonal matrix is said to be a scalar matrix if all the elements in its principal
diagonal are equal to some non-zero constant. A diagonal matrix is said to be a
scalar matrix if its diagonal elements are equal, that is, a square matrix B = [b ij]n × n is
said to be a scalar matrix if

• bij = 0, when i ≠ j • bij = k, when i = j,

for some constant k.

7) Zero or Null Matrix

A matrix is said to be zero matrix or null matrix if all its elements are zero.

8) Unit or Identity Matrix

If a square matrix has all elements 0 and each diagonal elements are non-zero, it is
called identity matrix and denoted by I.
Equal Matrices: Two matrices are said to be equal if they are of the same order and if
their corresponding elements are equal to the square matrix A = [a ij]n × n is an identity
matrix if

• aij = 1 if i = j
• aij = 0 if i ≠ j
We denote the identity matrix of order n by In. When the order is clear from the context,
we simply write it as I. For example,

9) Upper Triangular Matrix

A square matrix in which all the elements below the diagonal are zero is known as the
upper triangular matrix. For example,

10) Lower Triangular Matrix

A square matrix in which all the elements above the diagonal are zero is known as the
upper triangular matrix. For example,

MATRIX MULTIPLICATION AND SUBTRACTION


Multiplication

Unlike matrix addition, matrix multiplication does not require matrices to be of the
same dimensions. However, the number of rows in matrix M must be equal to the
number of colums in matrix N. For example:

For example:
Note, an

important propertry of matrices:

Thus, be careful when multiplying matrices. The order of multiplication matters.

Scalar Multiplication

Scalar multiplication is performed by multiplying a scalar with each corresponding


component in the matrix.

For example:

Addition/Subtraction

Matrix addition/subtraction is allowed between matrices that have the same


dimension. To add matrices simply add the corresponding component to each
other.
For example:

Matrix transposition

Transpose of a matrix

Transpose

A Transpose operation takes each row of a matrix


and converts it to a corresponding column.
Mathematically, a transpose is represented
as:

For example, the transpose of matrix M is


done as follows:
Why would you need to transpose a matrix? A matrix can be represented as either a
row-major or column-major matrix. During transformation operations, a vector
and a matrix must be in either the same row-major or colum-major format. If they
are not, the matrix must be transpose, so the results of the transformation are
correct.

The transpose of a matrix A, denoted by AT, A, A , A′,Atr, tA or At, may be


constructed by any one of the following methods:

1. Reflect A over its main diagonal (which runs from top-left to bottom-right) to
obtain AT
2. Write the rows of A as the columns of AT
3. Write the columns of A as the rows of AT
Formally, the i-th row, j-th column element of AT is the j-th row, i-th column element of
A:

If A is an m × n matrix, then AT is an n × m matrix.


In the case of square matrices, AT may also denote the Tth power of the matrix A.
For avoiding a possible confusion, many authors use left upper scripts, that is, they
denote the transpose as TA. An advantage of this notation is that no parentheses are
needed when exponents are involved: as (TA)n = T(An), notation TAn is not
ambiguous.
In this article this confusion is avoided by never using the symbol T as a
variable name.
Matrix definitions involving transposition

A square matrix whose transpose is equal to itself is called a symmetric matrix; that
is, A is symmetric if

A square matrix whose transpose is equal to its negative is called a


skewsymmetric matrix; that is, A is skew-symmetric if

A square complex matrix whose transpose is equal to the matrix with every
entry replaced by its complex conjugate (denoted here with an overline) is
called a Hermitian matrix (equivalent to the matrix being equal to its
conjugate transpose); that is, A is Hermitian if

A square complex matrix whose transpose is equal to the negation of its complex
conjugate is called a skew-Hermitian matrix; that is, A is skew-Hermitian if

A square matrix whose transpose is equal to its inverse is called an orthogonal matrix;
that is, A is orthogonal if

A square complex matrix whose transpose is equal to its conjugate inverse is called a
unitary matrix; that is, A is unitary if

Properties

Let A and B be matrices and c be a scalar.


1. The operation of taking the transpose is an involution (self-inverse).
2. The transpose respects addition.
3. Note that the order of the factors reverses.
4. From this one can deduce that a square matrix A is invertible if and only if AT is
invertible, and in this case we have (A−1)T = (AT)−1. By induction, this result
extends to the general case of multiple matrices, where we find that
(A1A2...Ak−1Ak)T = AkTAk−1T…A2TA1T.

5. The transpose of a scalar is the same scalar. Together with (2), this states that
the transpose is a linear map from the space of m × n matrices to the space of all
n × m matrices.
6. The determinant of a square matrix is the same as the determinant of its
transpose.
7. The dot product of two column vectors a and b can be computed as the single
entry of the matrix product: which is written as ai bi in Einstein summation
convention.
8. If A has only real entries, then ATA is a positive-semidefinite matrix.
9. The transpose of an invertible matrix is also invertible, and its inverse is the
transpose of the inverse of the original matrix. The notation A−T is sometimes
used to represent either of these equivalent expressions.
10. If A is a square matrix, then its eigenvalues are equal to the eigenvalues of its
transpose, since they share the same characteristic polynomial. Products
If A is an m × n matrix and AT is its transpose, then the result of matrix multiplication
with these two matrices gives two square matrices: A
AT is m × m and AT A is n × n. Furthermore, these products are symmetric matrices.
Indeed, the matrix product A AT has entries that are the inner product of a row of A with
a column of AT. But the columns of AT are the rows of A, so the entry corresponds to
the inner product of two rows of A. If pi j is the entry of the product, it is obtained from
rows i and j in A. The entry pj i is also obtained from these rows, thus pi j = pj i, and the
product matrix (pi j) is symmetric. Similarly, the product AT A is a symmetric matrix. A
quick proof of the symmetry of A AT results from the fact that it is its own transpose:

Implementation of matrix transposition on computers

Illustrat
ion of row- and column-major order
On a computer, one can often avoid explicitly transposing a
matrix in memory by simply accessing the same data in a
different order. For example, software libraries for linear
algebra, such as BLAS, typically provide options to specify
that certain matrices are to be interpreted in transposed
order to avoid the necessity of data movement.
However, there remain a number of circumstances in
which it is necessary or desirable to physically reorder a
matrix in memory to its transposed ordering. For example,
with a matrix stored in row-major order, the rows of the
matrix are contiguous in memory and the columns are
discontiguous. If repeated operations need to be
performed on the columns, for example in a fast Fourier
transform algorithm, transposing the matrix in memory (to
make the columns contiguous) may improve performance
by increasing memory locality.
Ideally, one might hope to transpose a matrix with minimal
additional storage. This leads to the problem of
transposing an n × m matrix in-place, with O(1) additional
storage or at most storage much less than mn. For n ≠ m,
this involves a complicated permutation of the data
elements that is non-trivial to implement in-place.
Therefore, efficient in-place matrix transposition has been
the subject of numerous research publications in computer
science, starting in the late 1950s, and several algorithms
have been developed.
INVERSE OF A MATRIX

What is the inverse of a matrix?


The definition of the inverse of a matrix is as follows:

The inverse of a matrix is a matrix that multiplied by the original matrix results in the
identity matrix, regardless of the order of the matrix multiplication.
Thus, let A be a square matrix, the inverse of matrix A is denoted by A -1 and satisfies: A·A-
=I
1

A-1·A=I Where
I is the identity matrix.

When can a matrix be inverted?


The easiest way to determine the invertibility of a matrix is by computing its determinant:

• If the determinant of the matrix is nonzero, the matrix is invertible.


• If the determinant of the matrix is equal to 0, the matrix cannot be inverted.
In such a case, the matrix is singular or degenerate. How to find the inverse of a
2×2 matrix
The formula to find the inverse of a 2×2 matrix is as follows:

As you can see, inverting a 2×2 dimension matrix is simple: you only have to solve the
determinant of the matrix (|A|), switch the elements on the main diagonal, and change
the sign of the elements on the secondary diagonal.
Inverse

In arithmetic, dividing a number by “4” is the same as multiplying a number by the


inverse of “4”, i.e., “1/4”. Division operation does not exist in matrix arithmetic.
However, it is possible to multiply a matrix by an inverse. The inverse of a matrix
is denoted as:

When a matrix is multiplied by its inverse, it produces an identity matrix. Similar to


when the real number “4” is multiplied by its inverse “1/4” produces “1”.

Keep in mind that not all matrices have an inverse.

You might also like