Cohen Sutherland line clipping algorithm
The algorithm uses the following main steps
- Divide the entire plane into nine disjoint regions using the four window boundaries of the window.
- Give a unique four bit region code to each region.
- Find out the code of two end points.
- Use the code to check (i) If the line segment can be trivially selected (ii) trivially rejected (iii) needs further processing.
- Find out the intersection with the window boundaries for line segments which need further processing.