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)?
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.