Question 75Asked in DSSSB TGT Computer Science (Technical), 7 Aug 2021, Shift 3

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…

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)?
  1. AP → 0001, Q → 0001
  2. BP → 1010, Q → 1001
  3. CP → 0001, Q → 1000
  4. DP → 0000, Q → 0110
Show answerHide answer

Correct answer: (C) P → 0001, Q → 1000

Explanation

Cohen-Sutherland code (TBRL): P(−4, 2) has x < −3, so it is left: 0001. Q(−1, 8) has y > 6, so it is above: 1000.

From DSSSB TGT Computer Science PYQ (Technical), 7 Aug 2021, Shift 3

This is question 75 of DSSSB TGT Computer Science PYQ (Technical), 7 Aug 2021, Shift 3. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.