Welcome to Journal of Graphics share: 

Journal of Graphics

Previous Articles     Next Articles

A line clipping algorithm against circular window based on intercepts

  

  • Online:2012-10-31 Published:2015-07-28

Abstract: Based on the premise that the center of circle is the coordinate origin, when the
two endpoints of a line segment are outside circular window after the line segment that both
endpoints are outside any boundary of circumscribed-square or at least one endpoint is inside
circular window is determined: if the absolute value of the intercept on x coordinate axis or y
coordinate axis is less than or equal to radius r, the intersection can be identified quickly;
otherwise, the intersection is identified according to point-line relation and comparison of
coordinates of intersections when the tangent and the line segment separately cross the edge of
circumscribed-square. The new algorithm can quickly calculate the intersections between a line
segment and circular window, avoid the complicated auxiliary operation and further improve the
clipping efficiency.

Key words: computer application, line clipping against circular window, intercept;
circumscribed-square