COM422 Tesr Marking Scheme_2023
COM422 Tesr Marking Scheme_2023
Question One
(a) Define Computer graphic.
Ans:
(a) Computer Graphic is an act of drawing pictures, lines, charts etc. on a computer screen using a
programming language.” [2 Marks]
(b) Differentiate between Raster Graphic and Vector Graphic in Tabular Form?
Raster images are the collection of the pixel. The Vector images are composed of paths.
Raster image takes less space to store. Vector image takes more space.
Raster graphics can draw mathematical curves, Vector graphics can only draw continuous
polygons, and boundaries. and smooth lines.
File Extension: .BMP, .TIF, .JPG etc. File Extension: .SVG, .PDF, .AI etc.
[ 6 Marks]
(c) In Which year was the first Digital Graphic Generated?
1940-1941 [2 Marks]
1|Page
Question Two
(a) With an aid of clear sketch, explain how the five components of CRT monitor
work.
Ans:
[4 Marks]
=> ∆x=xn-x0
∆y= yn-y0
Step 2:
2|Page
We need to calculate the decision parameter which is used to find the exact point to
draw a line: that is calculated as Pk= 2∆y-∆x
Step3:
case 1
if pk<0 Pk+1 =Pk+2∆y
xk+1=xk+1 current value Xk plus 1
and yk+1=yk
case 2
if Pk >=0 Pk+1 =Pk+2∆y-2∆x
xk+1=xk+1
yk+1=yk
Step 4
Repeat step 3 until end point is reach.
(b) What are the advantages of Breshenham’s Algorithm?
Ans
Advantages of Breshenham’s algorithm
1. It involves integer arithmetic, very simple.
2. It avoids the generation of duplicate point.
3. It can be implemented using hardware because it does not involve floating point.
[2Marks]
3|Page
Question THREE
a) What do you understand by transformation in the context of Computer
Graphics?
Ans:
The term Transformation is generally referred to as converting a graphic
into another graphic by applying some rules or algorithms. [2 Marks]
(c) Given a Point with coordinates (1, 2). Apply the translation with distance 4
towards x-axis and 4 towards the y-axis. Find the new coordinates without
changing the radius Sketch the Graph before and after translation?
Solution: P = (x0, y0) = (2,4) [1 Marks]
Shift Vector = (Tx, Ty) = (4, 2) [1 Marks]
Let us assume the new coordinates of P = (x1, y1)
Now we are going to add translation vector and given coordinates, then
x1 = x0 + Tx = (2 + 4) = 6 [1 Marks]
y1 = y0 + Ty = (4 + 2) = 6 [1 Marks]
Thus, the new coordinates = (6,6) [1 Marks]
4|Page
Question Four
(a) A line segment with the starting point (0, 0) and ending points (5, 5). Apply
45-degree rotation anticlockwise direction on the line. Find the new
coordinates of the line?
Solution- We can rotate the straight line by its endpoints with the same angle.
[each coordinate calculated correctly 4 Marks= 8 marks]
P1=P0 x Cos45 - Q0 x Sin45
5 x 0.7 – 5 x 0.71
0.7 – 3.55
-2.85
5 x 0.71 – 5 x 0.14
3.55 – 0.7
2.85
We have,
(P0, Q0) = (0, 0)
Rotation Angle () = 30°
Let the new coordinates of line = (P1, Q1)
We can apply the rotation matrix, then,
.
Thus, the new endpoint coordinates of the line are = (P1, Q1) = (1.83, 6.83)
5|Page