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 segme...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.展开更多
Regarding the problem that the traditional straight-line generating has a low accuracy, we study straightline generating with the distance of point to line. We explore generating a line to approximate the ideal line a...Regarding the problem that the traditional straight-line generating has a low accuracy, we study straightline generating with the distance of point to line. We explore generating a line to approximate the ideal line and the issue is to pick out the pixel point of approximating the ideal line. The paper plays a significant scientific role in elucidating linear optimization norm and it lays a foundation for showing a straight line. The algorithm is valuable for computer graphics.展开更多
文摘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.
基金supported by Xi'an University of Architecture and Technology under Grant No. JC0818,JC09112 and 2011028
文摘Regarding the problem that the traditional straight-line generating has a low accuracy, we study straightline generating with the distance of point to line. We explore generating a line to approximate the ideal line and the issue is to pick out the pixel point of approximating the ideal line. The paper plays a significant scientific role in elucidating linear optimization norm and it lays a foundation for showing a straight line. The algorithm is valuable for computer graphics.