Write a complete implementation of the Cohen Sutherland algorithm, putting together the pieces described.
Case Study - Implementation of the Cohen Sutherland Clipper in C++
Practice Exercises -
1. Why will a "divide by zero" never occur? Consider a vertical line segment such that delx is zero.
2. Do two chops in the same iteration? It would seem to improve performance if we replaced lines such "else if(code & 2)" with "if(c & 2)" and tried to do two line "chops" in succession. Show that this can lead to erroneous endpoints being computed, and hence to disaster.
Assignment Files - https://www.dropbox.com/s/6z9vhonc2j6biqr/Assignment%20Files.rar?dl=0