Problem
1. Implement the Cohen-Sutherland line-clipping algorithm.
2. Carefully discuss the rationale behind the various tests and methods for calculating the intersection parameters u, and u2 in the Liang-Barsky line-clipping algorithm.
3. Compare the number of arithmetic operations performed in the Cohen-Sutherland and the Liang-Barsky line-clipping algorithms for several different line orientations relative to a clipping window.
4. Write a procedure to implement the Liang-Barsky line-clipping algorithm.