Professional Documents
Culture Documents
𝟓
𝒑𝟎 = 𝟒 − 𝒓
If 𝒑𝒌 < 𝟎, the next point along the circle centered on (𝟎, 𝟎) is (𝒙𝒌 + 𝟏, 𝒚𝒌 ) &
𝒑𝒌+𝟏 = 𝒑𝒌 + 𝟐𝒙𝒌+𝟏 + 𝟏
Otherwise, the next point along the circle is (𝒙𝒌 + 𝟏, 𝒚𝒌 − 𝟏) &
𝒑𝒌+𝟏 = 𝒑𝒌 + 𝟐𝒙𝒌+𝟏 + 𝟏 − 𝟐𝒚𝒌+𝟏
Where 𝟐𝒙𝒌+𝟏 = 𝟐𝒙𝒌 + 𝟐, & 𝟐𝒚𝒌+𝟏 = 𝟐𝒚𝒌 − 𝟐.
(b) Use the Bresenham’s line drawing algorithm to rasterizing the line with
endpoints (1, 3) and (7, 9). Show all the necessary calculations for all the
intermediate points
(1,3) (2,4) (3,5) (4,6) (5,7) (6,8) (7,9)
(c) Write your comments on statement with justification:
“ Two dimensional rotation and scaling are cumulative, if
Sx = Sy or θ = nπ ”
R.S=S.R
(d) What is the difference between 4-connect region and 8-connect region for
polygon filling algorithm
(e) List and explain various character generation techniques
DVST CRT
it has flatscreen it maybe ormaynotbe flat screen
(b) Briefly explain Liang-Barsky line clipping algorithm. What are the advantages
of Liang-Barsky over Cohen Sutherland line clipping algorithm.
𝒑𝟏 = −∆𝒙, 𝒒𝟏 = 𝒙𝟏 − 𝒙𝒘𝒎𝒊𝒏
𝒑𝟐 = ∆𝒙, 𝒒𝟐 = 𝒙𝒘𝒎𝒂𝒙 − 𝒙𝟏
𝒑𝟑 = −∆𝒚, 𝒒𝟑 = 𝒚𝟏 − 𝒚𝒘𝒎𝒊𝒏
𝒑𝟒 = ∆𝒚, 𝒒𝟒 = 𝒚𝒘𝒎𝒂𝒙 − 𝒚𝟏
4. If 𝒑𝒌 = 𝟎 for any value of 𝒌 = 𝟏, 𝟐, 𝟑, 𝟒 (LRBT)then,
Line is parallel to 𝒌𝒕𝒉 boundary.
If corresponding 𝒒𝒌 < 𝟎 then,
Line is completely outside the boundary. Therefore, discard
line segment and Go to Step 8.
Otherwise(𝒒𝒌 ≥ 𝟎)
Check line is horizontal or vertical and accordingly check
line end points with corresponding boundaries.
If line endpoints lie within the bounded area
Then use them to draw line.
Otherwise
Use boundary coordinates to draw line.
And go to Step 8.
5. For 𝒌 = 𝟏, 𝟐, 𝟑, 𝟒 calculate 𝒓𝒌 for nonzero values of 𝒑𝒌 and 𝒒𝒌 as
follows:
𝒒
𝒓𝒌 = 𝒌 , 𝒇𝒐𝒓 𝒌 = 𝟏, 𝟐, 𝟑, 𝟒
𝒑𝒌
(c) Clip the line PQ having coordinates P(4,1) and Q(6,4) against the clip window
having vertices A(3,2) , B(7,2) , C(7,6) and D(3,6) using Cohen Sutherland line
clipping algorithm
(5,2)(6,4)