All mock tests are FREE till 31 December — register to save your progress

A rectangle is bounded by x = 0, y = 0, x = 5 and y = 3. The segment joining (−1, 0) and (4, 5), clipped against this window, connects the points

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. (0, 1) and (2, 3)

Explanation

The line is y = x + 1. It enters at x = 0 (y = 1) and leaves at y = 3 (x = 2).

More Programming Languages and Computer Graphics questions