Introduction - If you have any usage issues, please Google them yourself
The algorithm also called the encoding algorithm, the clipping window four edges where the line can put the plane into 9 regions, each region of the encoding including four is inside the 0 and 1 (for example, x coordinates less than left as 1, other recorded as 0), where the clipping window area is 0000, for encoding for endpoint on the line segment, the endpoint is equal to the region where the encoding. After encoding, it is easy to judge the situation of the two endpoints, for example, the sum is not equal to 0, and the line segment is outside the clipping window.