The Line Clipping Algorithm Basing on Affine Transformation

HTML  Download Download as PDF (Size: 105KB)  PP. 380-385  
DOI: 10.4236/iim.2010.26046    9,548 Downloads   15,639 Views  Citations
Author(s)

Affiliation(s)

.

ABSTRACT

A new algorithm for clipping line segments by a rectangular window on rectangular coordinate system is presented in this paper. The algorithm is very different to the other line clipping algorithms. For the line segments that cannot be identified as completely inside or outside the window by simple testings, this algorithm applies affine transformations (the shearing transformations) to the line segments and the window, and changes the slopes of the line segments and the shape of the window. Thus, it is clear for the line segment to be outside or inside of the window. If the line segments intersect the window, the algorithm immediately (no solving equations) gets the intersection points. Having applied the inverse transformations to the intersection points, the algorithm has the final results. The algorithm is successful to avoid the complex classifications and computations. Besides, the algorithm is effective to simplify the processes of finding the intersection points. Comparing to some classical algorithms, the algorithm of this paper is faster for clipping line segments and more efficient for calculations.

Share and Cite:

W. Huang, "The Line Clipping Algorithm Basing on Affine Transformation," Intelligent Information Management, Vol. 2 No. 6, 2010, pp. 380-385. doi: 10.4236/iim.2010.26046.

Copyright © 2024 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.