欢迎访问《图学学报》 分享到:

图学学报

• 几何设计与计算 • 上一篇    下一篇

一种基于截距的圆形窗口线裁剪算法

  

  • 出版日期:2012-10-31 发布日期:2015-07-28

A line clipping algorithm against circular window based on intercepts

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

摘要: 在圆形窗口圆心为坐标原点的前提下,确定两端点同时在外切正方形某边
界之外或至少有一端点在圆形窗口之内的线段之后,当线段两端点都在圆形窗口之外时:如
果线段所在直线在x 或y 任意坐标轴上截距的绝对值小于或等于圆半径r,则可快速判断线
段与圆形窗口是否相交;否则,再根据点-线位置关系以及所引切线与线段分别相交外切正
方形边的交点坐标相比较判断线段与圆形窗口是否相交。该方法可以加快线段与圆形窗口的
求交进程,避免复杂的辅助操作,显著提高裁剪效率。

关键词: 计算机应用, 圆形窗口线裁剪, 截距, 外切正方形

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