Abstract
Intersecting algorithms, especially line clipping in \({E^{2}}\) and \({E^{3}}\) in computer graphics, have been studied for a long time. Many different algorithms have been developed. The simplest case is a line clipping by a convex polygon in \({E^{2}}\) with O(N) computational complexity and with known polygon edges orientation. This contribution presents a new algorithm for a line clipping by a convex polygon in E\(^{2}\) with O(lg N) complexity, which is based on the point-in-half plane test. The proposed algorithm does not require prior knowledge of the polygon edge orientation. The vertices of the convex polygon and the clipped line can be given in projective space using homogeneous coordinates. The algorithm uses vector–vector operations for efficient implementation with SSE or AVX vector–vector instructions or on GPUs. It is simple and robust.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
Intersection algorithms in \(E^2\) and \(E^3\) have been intensively studied for a long time as they play important roles in many applications. In computer graphics, clipping algorithms have been deeply studied and fundamental algorithms have been described [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]. A survey of algorithms is given in [22].
Clipping algorithms in the \(E^2\) space mainly deal with a line or a line segment clipping by convex, non-convex non-intersecting polygons, and non-convex self-intersecting polygons [22, 23]. Clipping algorithms in the \(E^3\) space solve the intersection problem of line or line segments with convex and non-convex polyhedrons [22]. In practice, polyhedrons are represented by triangular meshes.
A deep survey of clipping and intersection algorithms in \(E^2\) and \(E^3\) spaces with an extensive list of references was published [22]. It contains over 230 references to known published papers related to clipping in \(E^2\) and \(E^3\).
The majority of algorithms have been developed for the Euclidean case. Few algorithms use homogeneous coordinates and the projective extension of Euclidean space or the principle of duality [24,25,26,27,28].
In the \(E^2\) case, algorithms deal with an intersection of a line or a half-line (ray) or a line segment with a 2D geometric entity, e.g., a rectangle [29,30,31,32], convex polygon [33,34,35], non-convex polygon [36], quadric and cubic curves, parametric curves [37] and areas with quadratic arcs [23, 38]. The famous line clipping algorithms are:
-
the Cohen–Sutherland algorithm [29] for a line segment clipping by a rectangular window; more efficient coding was described in [39],
-
the Cyrus–Beck’s line clipping algorithm by a convex polygon in \(E^2\) and its modification for line clipping by a convex polyhedron in \(E^3\) of the O(N) complexity [33, 34, 40].
However, the test if a line intersects a convex polygon in \(E^2\) is dual to the test point-in-convex polygon, which has the optimal complexity \(O(\lg {N})\).
It means that the optimal complexity of the line clipping by a convex polygon algorithm is \(O(\lg {N})\) in the \(E^2\) case.
1.1 Homogeneous coordinates
The projective extension of Euclidean space is not a part of standard computer science courses. However, homogeneous coordinates are used in computer graphics and computer vision algorithms, as they enable the representation of geometric transformations like translation and rotation by matrix multiplication and also offer to represent a point in infinity.
The mutual conversion between Euclidean space and projective space in the \(E^2\) case is given as:
where \(\textbf{X}=(X,Y)\), resp. \(\textbf{x}=[x,y:w]^T\), are coordinates in Euclidean space \(E^2\), resp. in projective space \(P^2\). The extension to the \(E^3\) case is straightforward.
The geometrical interpretation of Euclidean and projective spaces is presented in Fig. 1.
If the line p is given by two points \(\textbf{X}_A=(X_A,Y_A)\) and \(\textbf{X}_B=(X_B,Y_B)\) in Euclidean space, resp. \(\textbf{x}_A=[x_A,y_A:w_A]^T\) and \(\textbf{x}_B=[x_B,y_B:w_B]^T\) & \(w_A,w_B \ne 0\), the coefficients of the line p in \(E^2\) can be determined as [41]:
It can be rewritten in more compact form as:
where \(\textbf{x} =[x,y:w]^T\), \(\textbf{p} = [a,b:c]^T\) and \(\wedge \) is the outer product formally equivalent to the cross-product in this case.Footnote 1
The projective extension of Euclidean space enables the use of the principle of duality [25, 42, 43] in the intersection computation of two lines \(p_1\) and \(p_2\) in the \(E^2\) case using the outer product:
where \(\textbf{e}_i\) are basis vector of projective space \(P^2\), i.e., x, y, w coordinates.
It is due to the duality of lines and points in projective space [25, 42,43,44,45,46,47].
The outer product \(\textbf{x}_A \wedge \textbf{x}_B\) is formally equivalent to the cross-product \(\textbf{x}_A \times \textbf{x}_B \) in the \(P^2\) case. The non-normalized normal vector of the line p is \(\textbf{n}=(a,b) \triangleq [a,b:0]^T\) and \(c_i\) is the pseudo-distance of the line p from the origin of the coordinate system. (The symbol \(\triangleq \) means projectively equivalent.)
1.2 Principle of duality
The principle of duality is essential in general. Its application in geometry in connection with the implicit representation using projective geometry brings some new formulations or even new ones [25, 48,49,50,51]. The duality principle for basic geometric entities and operators is presented in Tables 1 and 2.
In the \(E^2\) case, a point is dual to a line and vice versa. The intersection of two lines is dual to a union of two points, i.e., a line given by two points, similarly for the \(E^3\) case.
1.3 Point-in-convex polygon test
The point-in-convex polygon test seems to be quite simple, and probably the first description was given in [52, 53]. The algorithms are simple with O(N) computational complexity, see Fig. 2. They are based on the half-plane tests, i.e., if the given point lies inside all half-planes, which form the given convex polygon and which can be given in an arbitrary order.
However, if the edges, resp. vertices, are ordered in the clockwise or anti-clockwise order, the point-in-convex polygon test has optimal complexity \(O(\lg {N})\), as binary search over vertex indexes can be used. Algorithms can also be found in [54,55,56,57], etc.
There are two basic approaches:
-
An implicit formulation \(F_i(\textbf{x})=0\), resp. \(F_i(\textbf{X})=0\), is used to represent polygon edges \(e_i\), see Eq. 5:
$$ \begin{aligned} \begin{aligned}&F_i(\textbf{X}) = a_i X + b_i Y +c_i \quad \text {in Euclidean space}\, E^2 \\&F_i(\textbf{x})= a_i x + b_i y + c_i w = \textbf{a}_i^T\textbf{x} \quad \text {in projective space}\, P^2 \\&X = \frac{x}{w} \quad , \quad Y = \frac{y}{w} \quad \& \quad w \ne 0 \end{aligned} \end{aligned}$$(5)and the half-plane test is defined as
$$ \begin{aligned} \begin{aligned}&F(\textbf{X}) = a_i X + b_i Y +c_i \ge 0 \quad \text {in Euclidean space} E^2 \\&F(\textbf{x}) = a_i x + b_i y + c_i w = \textbf{a}_i^T\textbf{x} \ge 0 ~ \& ~ w \ge 0 \quad \\&\text {in projective space} P^2 \end{aligned} \end{aligned}$$(6)If the edge \(e_i\) is given by vertices \(\textbf{x}_i\) and \(\textbf{x}_j = \textbf{x}_{i \oplus 1}\), then the coefficients \(\textbf{a}_i=[a_i,b_i:c_i]^T\) can be easily computed using the outer product.Footnote 2
$$\begin{aligned} \begin{aligned} \textbf{a}_i= \textbf{x}_i \wedge \textbf{x}_j = \textbf{x}_i \times \textbf{x}_j = \begin{vmatrix} \textbf{e}_1&\textbf{e}_2&\textbf{e}_w \\ x_i&y_i&w_i \\ x_j&y_j&w_j\\ \end{vmatrix} ~,\\~ i=0,\ldots N-1 ~,~ j= i \oplus 1\\ \end{aligned} \end{aligned}$$(7)where \(\textbf{e}_1\), \(\textbf{e}_2\), \(\textbf{e}_w\) form the orthonormal vector basis in projective space \(P^2\) and \(\oplus \) means \({\textbf {mod }}N\) addition operation. Then, the coefficients \(\textbf{a}_i\) of the line \(p_i\) on which the edge \(e_i\) lies can be expressed as:
$$\begin{aligned} \begin{aligned} \begin{vmatrix} a_i&b_i&c_i \\ x_i&y_i&w_i \\ x_j&y_j&w_j \end{vmatrix} = 0 \quad \text { or } \quad \begin{vmatrix} a_i&b_i&c_i \\ X_i&Y_i&1 \\ X_j&Y_j&1 \end{vmatrix} = 0 \end{aligned} \end{aligned}$$(8)where \(\textbf{a}_i=\textbf{x}_i \wedge \textbf{x}_j\), \(\textbf{x}_j=[x_i,y_i:w_i]^T, w_i\ne 0\) and \(\textbf{x}_j=[x_j,y_j:w_j]^T, w_j\ne 0\), using homogeneous coordinates.Footnote 3 This enables an easy extension of algorithms for the case when the polygon vertices are given in projective space.
-
The edges are represented as vectors in Euclidean space, i.e., the edge \(e_i\) given by points \(\textbf{X}_i\) and \(\textbf{X}_j\) is represented by a vector \(\textbf{s}_i=\textbf{X}_j-\textbf{X}_i\). In this case, the computation is restricted to Euclidean space representation.
However, there are other factors to be considered if an algorithm is to be used in practical applications:
-
Is the convex polygon given as an unordered set of edges, or are they ordered consequently? If ordered, are the edges oriented clockwise or anti-clockwise? If not ordered, are normal vectors oriented consistently?
-
Can preprocessing be beneficial to use? If more points are to be tested against the same convex polygon, some properties might be pre-computed, e.g., directional vectors \(\textbf{s}_i\), coefficients of the functions \(F_i(\textbf{x})\), etc. An extreme pre-computation case leads to O(1) run-time complexity [56, 58] with O(M N) preprocessing complexity, where M depends on the polygon’s geometric properties.
-
Is the centroid of the polygon or its estimation \(\textbf{x}_T\) given? It might be beneficial in some algorithms.
-
Efficiency of some algorithms might be sensitive to the ratio \(\frac{Area_{polygon}}{Area_{data~domain}}\).
-
Invariance factor? Is the algorithm invariant to translation and rotation?
Due to the principle of duality in \(E^2\), resp. \(P^2\), a point is dual to a plane and vice versa. Therefore, the point-in-convex polygon test is dual to a line convex polygon intersection algorithm (line clipping) test with \(O(\lg {N})\) complexity.
In the following, a new line convex polygon intersection (line clipping) algorithm with \(O(\lg {N})\) complexity in \(E^2\), resp. \(P^2\), is described.
2 Convex polygon clipping
The simplest case in the \(E^2\) case is a line clipping by a convex polygon. Algorithms used are of the O(N) complexity [31,32,33,34] and require oriented edges, i.e., clockwise or anticlockwise orientation. The edges can be given in an arbitrary order with consistently oriented normals.
The Cyrus–Beck(CB) [33] is the algorithm for a line clipping by a convex polygon with O(N) complexity, see Algorithm 1 and Fig. 3, It does not use the usual property of the consecutive order of vertices, i.e., edges. The algorithm is extensible for a line clipping by a convex polyhedron in the \(E^3\) case [59], where no specific order of faces is possible. It should be noted that the algorithm for a line clipping by a convex polygon with O(1) run-time complexity using preprocessing was described in [60].
The CB algorithm is based on a parametric formulation of the clipped line and an implicit formulation of lines of the convex polygon edges, see Eq. 9.
where \(\textbf{X}_A =(X_A,Y_A)\), \(\textbf{s}=(s_X,s_Y)\) is the directional vector of the clipped line p, \(\textbf{n}_i=(a_i,b_i)\) is the normal vector of the edge \(e_i\)Footnote 4 which lies on a line \(\textbf{p}_i= [a_i,b_i:c_i]^T\) given in the implicit form as \(a_i X + b_i Y + c_i = 0\).
Solving Eq. 9, the values \(t_0,\ldots ,t_{N-1}\) are computed and compared. However, \(N-2\) values are not used in the final processing, as the given line p can have up to 2 intersections with a convex polygon. It leads to significant computational inefficiency.
In most cases, the convex polygons in \(E^2\) are given by edges, resp. vertices, with a clockwise or anti-clockwise orientation. Such property is so significant that such knowledge should lead to algorithm complexity decrease. The orientation of edges, together with the convex property of the polygon, leads to the algorithm with \(O(\lg {N})\) complexity described [61].
The algorithm expects known knowledge of the convex polygon orientation, i.e., if the vertices are clockwise or anti-clockwise ordered. Also, it is not easy to correctly implement the CB algorithm, due to the close singular or singular cases solution, see Algorithm 1, line 10–11, as the value of \(\varepsilon \) is the programmer’s choice. Also, the vertices and the line are expected to be given in Euclidean space; otherwise, they must be converted
In the following, a new simple and robust algorithm for a line clipping by a convex polygon with \(O(\lg {N})\) in projective space \(P^2\), i.e., in the projective extension of Euclidean space \(E^2\), is given. It does not require prior knowledge of the convex polygon orientation, as the formulation uses the projective extension of Euclidean space \(P^2\). Due to the projective formulation, the vector–vector operations can be used, which is convenient for SSEFootnote 5 or AVXFootnote 6 vector–vector instructions use or in an implementation on GPUs.
It also eliminates close-to-singular cases caused by division operations.
3 Proposed algorithm
Let us consider fundamental situations in line clipping by a convex polygon, see Fig.4, where the convex polygon is represented by a circle.
Let three polygon vertices be given as:
-
the vertex \(\textbf{P}_a\) has coordinates \(\textbf{x}_0\),
-
the vertex \(\textbf{P}_b\) has coordinates \(\textbf{x}_k\), where \(k=\lfloor N/4 \rfloor \),
-
the vertex \(\textbf{P}_c\) has coordinates \(\textbf{x}_k\), where \(k=\lfloor N/2 \rfloor \).Footnote 7
where N is the number of edges of the given convex polygon.Footnote 8
The algorithm [61, 64] uses only two polygon vertices, but complex decision logic requires known vertices orientation and is limited to Euclidean space only. The proposed algorithm uses three vertices instead, is fully in projective space and uses vector–vector operations, instead.
It leads to a simple solution as four possible situations have to be solved, see Fig. 4:
-
\(case_0\)–complex case, as the line does not intersect the convex polygon or the line can intersect the edges of the segment \(a-b\) or \(b-c\) or \(c-a\),
-
\(case_1\) the line intersects the edges of the segments \(c-a\) and \(b-c\),
-
\(case_2\) the line intersects the edges of the segments \(a-b\) and \(b-c\),
-
\(case_3\) the line intersects the edges of the segments \(a-b\) and \(c-a\) (not shown in Fig. 4),
The given line p is represented in the implicit form \(F(\textbf{X})=0\) in Euclidean space, resp. \(F(\textbf{x})=0\), if the homogeneous coordinates are used as [6, 27, 28, 65, 66]:
The function \(F(\textbf{X})=0\), resp. \(F(\textbf{x})=0\), splits the \(E^2\) plane into two half-planes, i.e., given as \(F(\textbf{X})<0\), resp. \(F(\textbf{x})<0\), and \(F(\textbf{X}) \ge 0\), resp. \(F(\textbf{x}) \ge 0\). Then, the code \(C_k\) for the vertex \(P_k\) of the convex polygon is given as:
Table 3 presents all possible cases in Fig. 4.
As the line p is not oriented, the table is "symmetrical" and represents four fundamental cases as the cases \((case_3,case_4)\), \((case_2,case_5)\), \((case_1,case_6)\) and \((case_0, case_7)\) are equivalent.
It can be seen that simple logic expressions determine the segments intersected by the line p uniquely, except for one special non-simple case, i.e., \(case_0\) and \(case_7\).
In the cases \(case_1-case_3\) and \(case_4-case_7\), two segments are intersected. The intersections can be computed independently, e.g., in parallel, using a binary search over ordered vertices indexes with computational complexity \(O(\lg {N})\).
The cases, represented by \(case_0\) and \(case_7\), are more complex, as they cover two possible situations, i.e., the line p does not intersect the convex polygon, or it intersects a segment of the polygon edges, see Fig. 4.
However, the cases are easy to distinguish by finding a position of the point Q, defined as the intersection of the line p and an orthogonal line to the line p passing the vertex \(P_b\). If the points Q and \(P_a\) do not lie in the same half-plane, i.e., codes of the point \(C_Q \ne C_b\), then there is a possible intersection only on the segment \(c-a\) and the process is restarted with this segment only.
It can be seen that the SQ_CLIP algorithm, see Algorithm 2, for a line convex polygon intersection (line clipping) in the \(E^2\) case, is simple. The given description is recursive, as a non-recursive version is not so simple for explanation.
It should be noted that the algorithm uses projective representation for the polygon vertices and the given line p. In the case of Euclidean space, some operations can be simplified as the homogeneous coordinate \(w=1\). The proposed algorithm can be implemented as a non-recursive algorithm.
4 Conclusion
A new algorithm for line clipping by a convex polygon in \(E^2\) with \(O(\lg {N})\) complexity has been described. It uses the usual assumption that vertices of the convex polygon are consequently arranged, which is a significant property. The proposed algorithm is based on a simple idea of splitting polygon edges into three segments and binary search over indexes of the vertices; intersections for segments can be solved in parallel. The presented algorithm does not require prior knowledge of the polygon orientation. It uses implicit formulation and is fully projective using homogeneous coordinates.
The proposed algorithm:
-
does not compute temporary lines as in [56, 58] and uses only the inner product (dot product) to test a vertex position against the given line, and the outer product (cross-product) is only used for the final intersection computation. It should be emphasized that both operations take only one clock on the GPU,
-
does not require any division operation, except in the case, when final intersection points have to be converted to Euclidean space,
-
is more numerically robust as it does not need to solve singular or close-to-singular cases using the IF \(|q| < \varepsilon \) statement, as the Cyrus-Beck’s algorithm does,
-
it eliminates \(N-2\) parameter \(t_i\) computations in the CB algorithm,
-
is convenient for implementation using vector–vector operations using SSE, or AVX or implementation on GPUs,
-
is not convenient for triangles (a trivial case); in the case of 4-sided polygons, the algorithm [30] is to be used.
The proposed algorithm is not directly extensible for a line clipping by a convex polyhedron in \(E^3\), as no "ordering" of faces (triangles) is defined in the \(E^3\) case.
However, a line clipping algorithm with the expected \(O_{exp}(\sqrt{N})\) complexity was described in [40] if a triangular mesh gives the convex polyhedron.
It should be noted that a description of relevant intersection (clipping) algorithms and their modifications can be found in the extensive survey [22].
Notes
The colon ":" in \(\textbf{x}=[x,y:w]^T\) is used to emphasize that (x, y) has a different property from w as w is a "scaling" factor.
It should be noted that \(\textbf{n}_i=[a_i,b_i]^T\) defines the normal vector of the i-th edge, \(c_i\) represents pseudo-distance from the origin, and ":" is used intentionally.
Formally, the cross-product can be used as \(\textbf{a}_i=\textbf{x}_i \wedge \textbf{x}_j\) is equivalent to \(\textbf{a}_i=\textbf{x}_i \times \textbf{x}_j\) in the \(P^2\) case, i.e., generally \(w_i, w_j \ne 0\).
The colon ":" in \(\textbf{a}_i=[a_i,b_i:c_i]^T\) is used to emphasize that \((a_i,b_i)\) has a different property from \(c_i\) as it is a pseudo-distance of a line from the origin.
Streaming SIMD Extensions (SSE) [62] is a single instruction, multiple data (SIMD) instruction set extension to the x86 architecture defined in 1999.
Advanced Vector Extensions (AVX) [63] are SIMD extensions to the x86 instruction set architecture for microprocessors from Intel and Advanced Micro Devices (AMD) defined in 2008, extended to the AVX2 and used in 2013.
Better would be \(k=\lfloor N/3 \rfloor \) and \(k=\lfloor N2/3 \rfloor \), but it would lead to a division operation; \(k=\lfloor N/2 \rfloor \) is implemented as a shift to the right operation.
Usually, a polygon is physically represented by \(N+1\) points, i.e., \(\textbf{x}_0, \textbf{x}_1,\ldots ,\textbf{x}_{N-1},\textbf{x}_N \equiv \textbf{x}_0\).
References
Salomon, D.: The Computer Graphics Manual, pp. 1–1496. Springer, London, U.K. https://doi.org/10.1007/978-0-85729-886-7(2011)
Salomon, D.: Computer Graphics and Geometric Modeling, 1st edn. Springer, Berlin, Heidelberg (1999). https://doi.org/10.1007/978-1-4612-1504-2
Agoston, M.K.: Computer Graphics and Geometric Modelling: Mathematics. Springer, Berlin, Heidelberg (2005). https://doi.org/10.1007/b138899
Agoston, M.K.: Computer Graphics and Geometric Modelling: Implementation & Algorithms. Springer, Berlin, Heidelberg (2004). https://doi.org/10.1007/b138805
Lengyel, E.: Mathematics for 3D Game Programming and Computer Graphics, 3rd edn. Course Technology Press, Boston, MA, USA (2011)
Foley, J.D., Dam, A., Feiner, S., Hughes, J.F.: Computer Graphics - Principles and Practice, 2nd edn. Addison-Wesley, USA (1990)
Hughes, J.F., Dam, A., McGuire, M., Sklar, D.F., Foley, J.D., Feiner, S.K., Akeley, K.: Computer Graphics - Principles and Practice, 3rd edn. Addison-Wesley, USA (2014)
Ferguson, R.S.: Practical Algorithms for 3D Computer Graphics, 2nd edn. A. K. Peters Ltd, USA (2013)
Shirley, P., Marschner, S.: Fundamentals of Computer Graphics, 3rd edn. A. K. Peters Ltd, USA (2009)
Theoharis, T., Platis, N., Papaioannou, G., Patrikalakis, N.M.: Graphics and Visualization: Principles & Algorithms (1st Ed.). A K Peters/CRC Press, New York, USA . https://doi.org/10.1201/b10676(2008)
Comninos, P.: Mathematical and Computer Programming Techniques for Computer Graphics. Springer, Berlin, Heidelberg (2005). https://doi.org/10.1007/978-1-84628-292-8
Schneider, P.J., Eberly, D.H.: Geometric Tools for Computer Graphics. The Morgan Kaufmann Series in Computer Graphics, pp. 1–1009. Morgan Kaufmann, San Francisco (2003). https://doi.org/10.1016/B978-1-55860-594-7.50025-4
Angel, E., Shreiner, D.: Interactive Computer Graphics: A Top-Down Approach with Shader-Based OpenGL, 6th edn. Addison-Wesley Publishing Company, USA (2011)
Hill, F.S., Kelley, S.M.: Computer Graphics Using OpenGL, 3rd edn. Prentice-Hall Inc, USA (2006)
Watt, A.: Fundamentals of Three-Dimensional Computer Graphics. Addison-Wesley Longman Publishing Co., Inc, USA (1990)
Eberly, D.H.: Game Physics. Elsevier Science Inc., USA (2003)
Hearn, D.D., Baker, M.P., Carithers, W.: Computer Graphics with OpenGL, 4th edn. Prentice Hall Press, USA (2010)
Akenine-Moller, T., Haines, E., Hoffman, N.: Real-Time Rendering, 3rd edn. A. K. Peters Ltd, USA (2008)
Govil-Pai, S.: Principles of Computer Graphics: Theory and Practice Using OpenGL and Maya. Springer, Berlin, Heidelberg (2005)
Thomas, A.: Integrated Graphic and Computer Modelling, 1st edn. Springer, U.K. (2008)
Pharr, M., Jakob, W., Humphreys, G.: Physically Based Rendering: From Theory to Implementation, 3rd edn. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA (2016)
Skala, V.: A brief survey of clipping and intersection algorithms with a list of references (including triangle-triangle intersections). Informatica (Lithuania) 34(1), 169–198 (2023). https://doi.org/10.15388/23-INFOR508
Skala, V.: Algorithms for 2D line clipping. Eurographics 89, 355–366 (1989). https://doi.org/10.2312/egtp.19891026
Coxeter, H.S.M., Beck, G.: The Real Projective Plane. Springer, Berlin, Heidelberg (1992)
Johnson, M.: Proof by duality: or the discovery of “new” theorems. Mathematics Today December, 138–153 (1996)
Skala, V.: Intersection computation in projective space using homogeneous coordinates. Int. J. Image Graph. 8(4), 615–628 (2008). https://doi.org/10.1142/S021946780800326X
Vince, J.: Geometric Algebra: An Algebraic System for Computer Games and Animation, 1st edn. Springer, Berlin, Heidelberg (2009)
Vince, J.A.: Geometric Algebra for Computer Graphics, 1st edn. Springer, Santa Clara, CA, USA (2008). https://doi.org/10.1007/978-1-84628-997-2
Cohen, D.: Incremental Methods for Computer Graphics. Technical report, Harvard University, Cambridge, Massachusetts, USA . https://apps.dtic.mil/sti/pdfs/AD0694550.pdf(1969)
Skala, V.: A new line clipping algorithm with hardware acceleration. In: Proceedings of Computer Graphics International Conference, CGI, 270–273 https://doi.org/10.1109/CGI.2004.1309220(2004)
Skala, V.: Optimized line and line segment clipping in E2 and geometric algebra. Ann. Math. Inform. 52, 199–215 (2020). https://doi.org/10.33039/ami.2020.05.001
Bui, D.H., Skala, V.: Fast algorithms for clipping lines and line segments in E2. Visual Comput. 14(1), 31–37 (1998). https://doi.org/10.1007/s003710050121
Cyrus, M., Beck, J.: Generalized two- and three-dimensional clipping. Comput. Graph. 3(1), 23–28 (1978). https://doi.org/10.1016/0097-8493(78)90021-3
Liang, Y.-D., Barsky, B.A.: A new concept and method for line clipping. ACM Trans. Graph. (TOG) 3(1), 1–22 (1984). https://doi.org/10.1145/357332.357333
Rappoport, A.: An efficient algorithm for line and polygon clipping. Visual Comput. 7(1), 19–28 (1991). https://doi.org/10.1007/BF01994114
Weiler, K., Atherton, P.: Hidden surface removal using polygon area sorting. Proc. Annu. Conf. Comput. Graph. Interact. Tech., SIGGRAPH, 214–222 https://doi.org/10.1145/563858.563896(1977)
Skala, V.: Efficient intersection computation of the Bezier and Hermite curves with axis aligned bounding box. WSEAS Trans. Syst. 20, 320–323 (2021). https://doi.org/10.37394/23202.2021.20.36
Skala, V.: Algorithms for Clipping Quadratic Arcs. In: Chua, T.S., Kunii, T.L. (eds.) CGI Proceedings, pp. 255–268. Springer, Tokyo (1990). https://doi.org/10.1007/978-4-431-68123-6_16
Skala, V.: A New Coding Scheme for Line Segment Clipping in E2. Lecture Notes in Computer Science 12953 LNCS, 16–29 https://doi.org/10.1007/978-3-030-86976-2_2(2021)
Skala, V.: A fast algorithm for line clipping by convex polyhedron in E3. Comput. Graph. (Pergamon) 21(2), 209–214 (1997). https://doi.org/10.1016/s0097-8493(96)00084-2
Skala, V.: Barycentric coordinates computation in homogeneous coordinates. Comput. Graph. (Pergamon) 32(1), 120–127 (2008). https://doi.org/10.1016/j.cag.2007.09.007
Skala, V., Karim, S.A.A., Kadir, E.A.: Scientific computing and computer graphics with GPU: Application of projective geometry and principle of duality. Int. J. Math. Comput. Sci. 15(3), 769–777 . http://ijmcs.future-in-tech.net/15.3/R-Skala-AbdulKarim.pdf(2020)
Arokiasamy, A.: Homogeneous coordinates and the principle of duality in two dimensional clipping. Comput. Graph. 13(1), 99–100 (1989). https://doi.org/10.1016/0097-8493(89)90045-9
Skala, V.: Length, area and volume computation in homogeneous coordinates. Int. J. Image Graph. 6(4), 625–639 (2006). https://doi.org/10.1142/S0219467806002422
Skala, V.: A new approach to line - sphere and line - quadrics intersection detection and computation. AIP Conf. Proc. 1648, 1–4 (2015). https://doi.org/10.1063/1.4913058
Skala, V.: Duality, barycentric coordinates and intersection computation in projective space with GPU support. WSEAS Trans. Math. 9(6), 407–416 (2010)
Skala, V.: Projective geometry, duality and Plücker coordinates for geometric computations with determinants on GPUs. ICNAAM 2017 1863https://doi.org/10.1063/1.4992684(2017)
Skala, V.: Geometric transformations and duality for virtual reality and haptic systems. Commun. Comput. Inform. Sci. 434, 642–647 (2014). https://doi.org/10.1007/978-3-319-07857-1_113
Skala, V.: Duality and intersection computation in projective space with GPU support. In: International Conference on Applied Mathematics, Simulation, Modelling - Proceedings, pp. 66–71 (2010)
Skala, V., Kuchař, M.: The hash function and the principle of duality. In: Proceedings of Computer Graphics International Conference, CGI, pp. 167–174 (2001)
Skala, V.: Geometry, duality and robust computation in engineering. WSEAS Trans. Comput. 11(9), 275–293 (2012)
Franklin, W.R.: PNPOLY-Point Inclusion in Polygon Test. [Online; accessed 6-August-2023] . https://wrfranklin.org/Research/Short_Notes/pnpoly.html(1994)
Shimrat, M.: Algorithm 112: Position of point relative to polygon. Commun. ACM 5(8), 434 (1962). https://doi.org/10.1145/368637.368653
Haines, E.: Point in Polygon Strategies, pp. 24–46. Academic Press Professional, Inc., USA . https://doi.org/10.1016/B978-0-12-336156-1.50013-6(1994)
Bourke, P.: Determining if a point lies on the interior of a polygon. [Online; accessed 6-September-2021] . http://masters.donntu.org/2009/fvti/hodus/library/article2/article2.html(1997)
Skala, V.: Trading time for space: An O(1) average time algorithm for point-in-polygon location problem: Theoretical fiction or practical usage? Mach. Graph. Vis. 5(3), 483–494 . http://afrodita.zcu.cz/~skala/PUBL/PUBL_1996/1996_POINT-IN.PDF(1996)
Ochilbek, R.: A new approach (extra vertex) and generalization of shoelace algorithm usage in convex polygon (point-in-polygon). In: 14th International Conference on Electronics Computer and Computation, ICECCO 2018 https://doi.org/10.1109/ICECCO.2018.8634725(2019)
Skala, V.: Point-in-convex polygon and point-in-convex polyhedron algorithms with O(1) complexity using space subdivision. In: AIP Conference Proceedings 1738https://doi.org/10.1063/1.4952270 . https://doi.org/10.48550/arXiv.2208.03682(2016)
Skala, V.: An efficient algorithm for line clipping by convex and non-convex polyhedra in E3. Comput. Graph. Forum 15(1), 61–68 (1996). https://doi.org/10.1111/1467-8659.1510061
Skala, V.: Line clipping in E2 with O(1) processing complexity. Comput. Graph. (Pergamon) 20(4), 523–530 (1996). https://doi.org/10.1016/0097-8493(96)00024-6
Skala, V.: An efficient algorithm for line clipping by convex polygon. Comput. Graph. 17(4), 417–421 (1993). https://doi.org/10.1016/0097-8493(93)90030-D
Wikipedia contributors: Streaming SIMD Extensions — Wikipedia, The Free Encyclopedia. https://en.wikipedia.org/w/index.php?title=Streaming_SIMD_Extensions &oldid=1179009683. [Online; accessed 17-March-2024] (2023)
Wikipedia contributors: Advanced Vector Extensions — Wikipedia, The Free Encyclopedia. [Online; accessed 17-March-2024] . https://en.wikipedia.org/w/index.php?title=Advanced_Vector_Extensions &oldid=1212839739(2024)
Skala, V.: O(lg N) line clipping algorithm in E2. Comput. Graph. 18(4), 517–524 (1994). https://doi.org/10.1016/0097-8493(94)90064-7
Salomon, D.: Transformations and Projections in Computer Graphics. Springer, Berlin, Heidelberg (2006). https://doi.org/10.1007/978-1-4612-1504-2_3
Vince, J.: Introduction to the Mathematics for Computer Graphics, 3rd edn. Springer, Berlin, Heidelberg (2010). https://doi.org/10.1007/978-1-4471-6290-2
Acknowledgements
The author thanks colleagues and students at the University of West Bohemia in Pilsen for their comments and recommendations, as they stimulated this work and suggestions proposed, to anonymous reviewers for hints, constructive suggestions and critical comments. Thanks also to colleagues at the Shandong University in Jinan and Zhejiang University in Hangzhou, China, for recent discussions and sharing their knowledge. Thanks also belong to several authors of recently published relevant papers [22] for sharing their views and hints provided.
Funding
Open access publishing supported by the National Technical Library in Prague.
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Skala, V. A new fully projective O(lg N) line convex polygon intersection algorithm. Vis Comput (2024). https://doi.org/10.1007/s00371-024-03413-3
Accepted:
Published:
DOI: https://doi.org/10.1007/s00371-024-03413-3