Based on the analysis of advantages and disadvantages of the existing algorithms, a new
algorithm for line clippingwas proposed. This algorithm is composed of three steps: the intersection points
of a line to be clipped and a general polygon are calculated, the line is cut into several sub-lines based on
the intersection points, and whether these sub-line are cut or not is decided in light of their central points.
The algorithm can deal with all kinds of situations easily and correctly.