Question discussion

Consider a rectangular window whose lower left hand corner is at (–3, 1) and upper right hand corner is at (2, 6). What is 4 bit region cod…

5241Medium DSSSB TGT Computer Science 0 replies 0 views
0
Consider a rectangular window whose lower left hand corner is at (–3, 1) and upper right hand corner is at (2, 6). What is 4 bit region code for endpoint of line PQ having co-ordinates (–4, 2) and (–1, 8)?
  • AP ⟶ 0001, Q ⟶ 0001
  • BP ⟶ 0000, Q ⟶ 0110
  • CP ⟶ 1010, Q ⟶ 1001
  • DP ⟶ 0001, Q ⟶ 1000
Correct answer: D

Explanation

Window x: −3 to 2, y: 1 to 6. Region code is Top-Bottom-Right-Left. P(−4, 2) is left of the window → 0001; Q(−1, 8) is above the window → 1000.

Discussion 0

Nobody has replied yet. Start the discussion!