# Line Clipping in 2D: Overview, Techniques and Algorithms

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Fundamental Line-Clipping Algorithms

#### 2.1. Cohen–Sutherland

#### 2.2. Cyrus–Beck

#### 2.3. Liang–Barsky

- −
- If the line has ${p}_{k}=0$ then it is parallel to the corresponding clipping-window edge.
- −
- If the line has ${p}_{k}=0$ and ${q}_{k}<0$ then it is completely outside and is being rejected.
- −
- If ${p}_{k}>0$, the line proceeds from the inside to the outside.
- −
- If ${p}_{k}<0$, the line proceeds from the outside to the inside.

#### 2.4. Nicholl–Lee–Nicholl

- 90° clockwise rotation about the origin.
- 180° clockwise rotation about the origin.
- 270° clockwise rotation about the origin.
- Reflection about the line $x=-y$.
- Reflection about the $x-$axis.

- ${P}_{0}$ is inside the clipping window and ${P}_{1}$ outside.The algorithm sets up four regions (L, T, R, B) as in Figure 12. Then, depending on which one of the four regions contains ${P}_{1}$, it computes the line-intersection position with the corresponding window boundary.
- ${P}_{0}$ is on the edge region and ${P}_{1}$ is outside the clipping window.The algorithm sets up four regions labeled L, LT, LR, and LB as in Figure 13. These four regions again determine a unique clipping-window edge for the line segment, relative to the position of ${P}_{1}$. For instance, if ${P}_{1}$ is in any one of the three regions labeled L, the algorithm clips the line at the left window border and draws the line segment from this intersection point to ${P}_{1}$. If ${P}_{1}$ is in region LT, it draws the line segment from the left window boundary to the top boundary. Likewise, the same logic applies to regions LR and LB. However, if ${P}_{1}$ is not in any of these four regions, the line is clipped entirely.
- ${P}_{0}$ is on the corner region and ${P}_{1}$ is outside the clipping window.When ${P}_{0}$ is to the corner region, the algorithm uses one of the two sets as shown in Figure 14. The selection of (a) or (b) depends on the position of ${P}_{0}$ within the corner region. When ${P}_{0}$ is closer to the left clipping boundary of the window, the algorithm uses the regions in (a) of this figure but when ${P}_{0}$ is closer to the top clipping boundary of the window, it uses the regions in (b). If ${P}_{1}$ is in one of the regions T, L, TR, TB, LR, or LB, this determines a unique clipping-window border for the intersection calculations, otherwise, the entire line is rejected.

- ${m}_{1}<m<{m}_{2}\to {P}_{1}$ is above the clipping window.
- ${m}_{2}<m<{m}_{3}\to {P}_{1}$ is on the right of the clipping window.
- ${m}_{3}<m<{m}_{4}\to {P}_{1}$ is below the clipping window.
- ${m}_{4}<m<{m}_{1}\to {P}_{1}$ is on the left of the clipping window.

## 3. Common Line-Clipping Algorithms

#### 3.1. Midpoint Subdivision

**Totally visible**: If the outcode of both line segment endpoints is 0000 then the line segment is inside the clipping window and it is completely visible.**Totally invisible**: Bitwise AND between the two outcodes of the line segment endpoints. If the result is not 0000 then the line endpoints share the same region and the line segment does not cross the clipping window so it is rejected.**Clipping candidate**: If the line is in neither Category 1 nor Category 2 then it is partially visible and has to be subdivided into two equal parts. The visibility tests are then applied to each half. This subdivision process is repeated until we obtain completely visible and completely invisible line segments.

#### 3.2. Skala 2005

Algorithm 1: Function to determine the outcode of the endpoints. |

function CODE(x);begin c := [0000]; if x < ${x}_{min}$thenc := [1000]else if x > ${x}_{max}$thenc := [0100];if y < ${y}_{min}$thenc := c lor [1001]else if y > ${y}_{max}$thenc := c lor [0010]; CODE := c end [CODE]; |

#### 3.3. S-Clip E2

## 4. Uncommon Line-Clipping Algorithms

#### 4.1. Kodituwakku–Wijeweere–Chamikara

#### 4.2. Matthes–Drakopoulos Line Clipping against a Rectangular Window

- Step 1

${x}_{1}<{x}_{min}$ AND ${x}_{2}<{x}_{min}$ | (line is left to the clipping window) |

${x}_{1}>{x}_{max}$ AND ${x}_{2}>{x}_{max}$ | (line is right to the clipping window) |

${y}_{1}<{y}_{min}$ AND ${y}_{2}<{y}_{min}$ | (line is under the clipping window) |

${y}_{1}>{y}_{max}$ AND ${y}_{2}>{y}_{max}$ | (line is over the clipping window) |

- Step 2

- If ${x}_{i}<{x}_{min}$ then$${x}_{i}={x}_{min}$$$${y}_{i}={y}_{1}+\frac{({y}_{2}-{y}_{1})}{({x}_{2}-{x}_{1})}\xb7({x}_{min}-{x}_{1})$$
- If ${x}_{i}>{x}_{max}$ then$${x}_{i}={x}_{max}$$$${y}_{i}={y}_{1}+\frac{({y}_{2}-{y}_{1})}{({x}_{2}-{x}_{1})}\xb7({x}_{max}-{x}_{1})$$
- If ${y}_{i}<{y}_{min}$ then$${y}_{i}={y}_{min}$$$${x}_{i}={x}_{1}+\frac{({x}_{2}-{x}_{1})}{({y}_{2}-{y}_{1})}\xb7({y}_{min}-{x}_{1})$$
- If ${y}_{i}>{y}_{max}$ then$${y}_{i}={y}_{max}$$$${x}_{i}={x}_{1}+\frac{({x}_{2}-{x}_{1})}{({y}_{2}-{y}_{1})}\xb7({y}_{max}-{x}_{1})$$

- Step 3

`// INPUT DATA: x1, y1, x2, y2, xmin, ymax, xmax, ymin //`

`if(!(x1 < xmin && x2 < xmin) && !(x1 > xmax && x2 > xmax))`

`if(!(y1 < ymin && y2 < ymin) && !(y1 > ymax && y2 > ymax))`

`{`

`x[0] = x1;`

`y[0] = y1;`

`x[1] = x2;`

`y[1] = y2;`

`i = 1;`

`do`

`{`

`if(x[i] < xmin)`

`{`

`x[i] = xmin;`

`y[i] = ((y2 - y1)/(x2 - x1)) * (xmin - x1) + y1;`

`}`

`else if(x[i] > xmax)`

`{`

`x[i] = xmax;`

`y[i] = ((y2 - y1)/(x2 - x1)) * (xmax - x1) + y1;`

`}`

`if(y[i] < ymin)`

`{`

`y[i] = ymin;`

`x[i] = ((x2 - x1)/(y2 - y1))*(ymin - y1) + x1;`

`}`

`else if(y[i] > ymax)`

`{`

`y[i] = ymax;`

`x[i] = ((x2 - x1)/(y2 - y1)) * (ymax - y1) + x1;`

`}`

`i++;`

`}`

`while(i <= 1);`

`if(!(x[0] < xmin && x[1] < xmin) && !(x[0] > xmax && x[1] > xmax))`

`draw_line(x[0], y[0], x[1], y[1]);`

`}`

## 5. Evaluation of All Line-Clipping Algorithms against a Rectangular Window

## 6. Line Clipping vs. Polygon Clipping

## 7. Matthes–Drakopoulos Line Clipping against a Convex Polygon

#### 7.1. Mathematical Background: The Cross Product

- Has zero length, when the vectors $\mathbf{a}$ and $\mathbf{b}$ are in the same or the opposite direction.
- It reaches the maximum length when the vectors $\mathbf{a}$ and $\mathbf{b}$ are at right angles.
- The direction changes depending on the angle of vectors $\mathbf{a}$ and $\mathbf{b}$; see Figure 32.

`// INPUT: arbitary point P, line points A & B`

`// OUTPUT: cross product (clockwise order)`

`// > 0 : left side`

`// < 0 : right side`

`// = 0 : on the line`

`float cross_product(point P, point A, point B)`

`{`

`return (B.x - A.x) * (P.y - A.y) - (B.y - A.y) * (P.x - A.x);`

`}`

#### 7.2. Further Analysis of the Cross Product

- The 2D cross product of point I with the line segment $AB$ is zero.
- The 2D cross product of point I with the line segment $CD$ is zero.

`point intersection(point A, point B, point C, point D)`

`{`

`// calculate the intersection point between lines AB and CD`

`point d1 = {B.x - A.x, B.y - A.y};`

`point d2 = {D.x - C.x, D.y - C.y};`

`float n1 = C.x * d2.y - C.y * d2.x;`

`float n2 = A.x * d1.y - A.y * d1.x;`

`float n3 = 1/(d2.y * d1.x - d1.y * d2.x);`

`float x = (n1 * d1.x - n2 * d2.x) * n3;`

`float y = (n1 * d1.y - n2 * d2.y) * n3;`

`return {x, y};`

`}`

#### 7.3. Description of the Algorithm

#### 7.4. Analysis

- Simultaneously right to the edge.
- One of them is on the edge and the other is right of the edge.

#### 7.5. The Steps of the Algorithm

- Check against an edge of the polygon which is defined by the vertices ${P}_{i}({x}_{i},{y}_{i})$ and ${P}_{i+1}({x}_{i+1},{y}_{i+1})$ where the points $A({x}_{a},{y}_{a})$ and $B({x}_{b},{y}_{b})$ of the line reside. Each point may reside to the left of the edge, to the right of the edge or on the edge.
- If both of the points are to the left of the edge then stop the algorithm and draw nothing. The line is completely outside the convex polygon.
- If only point A is to the left of the edge then calculate the intersection point between the edge and the line. Replace the coordinates of point A with those coordinates of the intersection point and repeat from Step 1 with the next edge.
- If only point B is to the left of the edge then calculate the intersection point between the edge and the line. Replace the coordinates of point B with those coordinates of the intersection point and repeat from Step 1 with the next edge.
- If both points A and B are to the right of the edge or one of them is on the edge and the other is right of the edge then repeat from Step 1 with the next edge or stop if you have checked all N edges.
- Draw the clipped line from point A to point B.

#### 7.6. Pseudo-Code (C++ Based)

`// INPUT : point A, point B, N, point polygon[N + 1] (last vertex is equal to first)`

`// OUTPUT : clipped line segment from point A to point B`

`float sideA, sideB;`

`bool draw = true;`

`for(int i = 0; i < N; i++)`

`{`

`// sideX > 0 --> LEFT`

`// sideX < 0 --> RIGHT`

`// sideX = 0 --> ON THE EDGE`

`sideA = cross_product(A, polygon[i], polygon[i + 1]);`

`sideB = cross_product(B, polygon[i], polygon[i + 1]);`

`if(sideA > 0 && sideB > 0)`

`{`

`// line is completely outside`

`draw = false;`

`break;`

`}`

`if(sideA > 0 && sideB <= 0)`

`// point A is outside, point B is inside polygon or on the edge`

`A = intersection(A, B, polygon[i], polygon[i + 1]);`

`else if(sideB > 0 && sideA <= 0)`

`// point B is outside, point A is inside polygon or on the edge`

`B = intersection(A, B, polygon[i], polygon[i + 1]);`

`}`

`if(draw)`

`draw_line(A, B);`

## 8. Evaluation of All Line-Clipping against a Convex Polygon Algorithms

## 9. Summary

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Hearn, D.; Baker, M.P. Computer Graphics C Version, 2nd ed.; Prentice Hall: Upper Saddle River, NJ, USA, 1997. [Google Scholar]
- Comninos, P. Mathematical and Computer Programming Techniques for Computer Graphics; Springer: London, UK, 2006. [Google Scholar] [CrossRef]
- Cyrus, M.; Beck, J. Generalized two- and three-dimensional clipping. Comput. Graph.
**1978**, 3, 23–28. [Google Scholar] [CrossRef] - Liang, Y.D.; Barsky, B.A. A new concept and method for line clipping. ACM Trans. Graph. (TOG)
**1984**, 3, 1–22. [Google Scholar] [CrossRef] - Nicholl, T.M.; Lee, D.; Nicholl, R.A. An efficient new algorithm for 2-D line clipping: Its development and analysis. Comput. Graph.
**1987**, 21, 253–262. [Google Scholar] [CrossRef] - Sobkow, M.S.; Pospisil, P.; Yang, Y. A Fast Two-Dimensional Line Clipping Algorithm Via Line Encoding. Comput. Graph.
**1987**, 11, 459–467. [Google Scholar] [CrossRef] - Skala, V. An efficient algorithm for line clipping by convex polygon. Comput. Graph.
**1993**, 17, 417–421. [Google Scholar] [CrossRef] - Skala, V. O(lgN) Line clipping algorithm in E
^{2}. Comput. Graph.**1994**, 18, 517–524. [Google Scholar] [CrossRef] [Green Version] - Skala, V. A new approach to line and line segment clipping in homogeneous coordinates. Vis. Comput.
**2005**, 21, 905–914. [Google Scholar] [CrossRef] - Skala, V. S-clip E2: A new concept of clipping algorithms. SIGGRAPH Asia
**2012**, 2012, 39. [Google Scholar] [CrossRef] - Ray, B.K. A Line Segment Clipping Algorithm in 2D. Int. J. Comput. Graph.
**2012**, 3, 51–76. [Google Scholar] - Andreev, R.; Sofianska, E. New algorithm for two-dimensional line clipping. Comput. Graph.
**1991**, 15, 519–526. [Google Scholar] [CrossRef] - Day, J.D. An algorithm for clipping lines in object and image space. Comput. Graph.
**1992**, 16, 421–426. [Google Scholar] [CrossRef] - Rappoport, A. An efficient algorithm for line and polygon clipping. Vis. Comput.
**1991**, 7, 19–28. [Google Scholar] [CrossRef] - Dimri, S.C. A simple and efficient algorithm for line and polygon clipping in 2-D computer graphics. Int. J. Comput. Appl.
**2015**, 127, 31–34. [Google Scholar] - Huang, W. A Novel Algorithm for Line Clipping. In Proceedings of the 2009 International Conference on Computational Intelligence and Software Engineering, Wuhan, China, 11–13 December 2009; pp. 1–5. [Google Scholar] [CrossRef]
- Huang, W. The Line Clipping Algorithm Basing on Affine Transformation. Intell. Inf. Manag.
**2010**, 2, 2029. [Google Scholar] [CrossRef] [Green Version] - Elliriki, M.; Reddy, C.; Anand, K. An efficient line clipping algorithm in 2D space. Int. Arab J. Inf. Technol.
**2019**, 16, 798–807. [Google Scholar] - Pandey, A.; Jain, S. Comparison of various line clipping algorithms for Improvement. Int. J. Mod. Eng. Res.
**2013**, 3, 69–74. [Google Scholar] - Shilpa; Arora, P. Clipping in Computer Graphics-A review. In International Journal Of Advance Research And Innovative Ideas In Education; IJARIIE: Gujarat, India, 2016; Volume 2, pp. 1725–1730. [Google Scholar]
- Nisha. Comparison of various line clipping algorithms: Review. Int. J. Adv. Res. Comput. Sci. Softw. Eng.
**2017**, 7, 68–71. [Google Scholar] [CrossRef] - Cohen, D. Incremental Methods for Computer Graphics. Ph.D. Thesis, Harvard University, Cambridge, MA, USA, 1969. [Google Scholar]
- Sproull, R.; Sutherland, I. A clipping divider. In Proceedings of the Fall Joint Computer Conference, Part I, AFIPS ’68 (Fall, Part I), New York, NY, USA, 9–11 December 1968; Association for Computing Machinery: New York, NY, USA, 1968; pp. 765–775. [Google Scholar] [CrossRef]
- Sutherland, I. Display Windowing by Clipping. U.S. Patent 3 639 736, 1 February 1972. [Google Scholar]
- Hearn, D.; Baker, M.P.; Carithers, W.R. Computer Graphics with Open GL, 4th ed.; Pearson Education Limited: Edinburgh Gate, UK; Harlow, UK; Essex, UK, 2014. [Google Scholar]
- Kodituwakku, S.R.; Wijeweera, K.R.; Chamikara, M.A.P. An efficient algorithm for line clipping in computer graphics programming. Ceylon J. Sci. (Phys. Sci.)
**2013**, 1, 1–7. [Google Scholar] - Matthes, D.; Drakopoulos, V. A simple and fast line-clipping method as a Scratch extension for computer graphics education. Comput. Sci. Inf. Technol.
**2019**, 7, 40–47. [Google Scholar] [CrossRef] [Green Version] - Matthes, D.; Drakopoulos, V. Another simple but faster method for 2D line clipping. Int. J. Comput. Graph. Animat.
**2019**, 9, 1–15. [Google Scholar] [CrossRef] - Rogers, D.F. Procedural Elements for Computer Graphics, 2nd ed.; McGraw-Hill, Inc.: New York, NY, USA, 1997. [Google Scholar] [CrossRef]
- Weiler, K.; Atherton, P. Hidden Surface Removal Using Polygon Area Sorting. In Proceedings of the 4th Annual Conference on Computer Graphics and Interactive Techniques, SIGGRAPH ’77, San Jose, CA, USA, 20–22 July 1977; Association for Computing Machinery: New York, NY, USA, 1977; pp. 214–222. [Google Scholar] [CrossRef]
- Sutherland, I.; Hodgman, G. Reentrant Polygon Clipping. Commun. ACM
**1974**, 17, 32–42. [Google Scholar] [CrossRef] - Greiner, G.; Hormann, K. Efficient clipping of arbitrary polygons. ACM Trans. Graph.
**1998**, 17, 71–83. [Google Scholar] [CrossRef] - Vatti, B.R. A generic solution to polygon clipping. Commun. ACM
**1992**, 35, 56–63. [Google Scholar] [CrossRef]

**Figure 2.**The codes for the nine regions of the Cohen-Sutherland algorithm in the two-dimensional space.

**Figure 6.**Classifying intersection points either as Potentially Entering (PE) or Potentially Leaving (PL) and calculating their t parameter, respectively.

**Figure 11.**Applying 270 degrees clockwise rotation for moving the first line endpoint into the edge region.

**Figure 14.**The two possible sets of clipping regions used in the NLN algorithm when ${P}_{0}$ is (

**a**) above and (

**b**) to left of the clipping window.

**Figure 15.**(

**a**) ${m}_{1},\phantom{\rule{0.166667em}{0ex}}{m}_{2},\phantom{\rule{0.166667em}{0ex}}{m}_{3},\phantom{\rule{0.166667em}{0ex}}{m}_{4}$ are the slopes of the line segments formed between ${P}_{0}$ and L, T, R, B, boundaries respectively. (

**b**) m is the slope of the line segment ${P}_{0}{P}_{1}$.

**Figure 21.**Line is intersecting the boundaries; The new line endpoints ${A}^{\u2033}$ and ${B}^{\u2033}$ have been calculated.

**Figure 25.**Defining the clipping window as well as the two-dimensional space for generating arbitrary lines.

**Figure 27.**Clipping three consecutive lines that form a triangle against a convex polygon. The result is clipped lines.

**Figure 31.**The cross product equals the area of a parallelogram with vectors $\mathbf{a}$ and $\mathbf{b}$ used as sides of the parallelogram.

**Figure 33.**From the sign of the 2D cross product we can determine, if vector $\mathbf{b}$ is to the left, to the right or on vector $\mathbf{a}$.

**Figure 35.**Using the 2D cross product to determine the position of the point P comparing to the line segment E.

**Figure 44.**Average time of each algorithm when clipping 10 million lines against convex polygons with different number of edges (lower is better).

**Figure 45.**Speed graph of each algorithm when clipping 10 million lines against convex polygons with different number of edges (lower is better).

c | ${\mathit{c}}_{3}$ | ${\mathit{c}}_{2}$ | ${\mathit{c}}_{1}$ | ${\mathit{c}}_{0}$ | TAB1 | TAB2 | MASK |
---|---|---|---|---|---|---|---|

0 | 0 | 0 | 0 | 0 | None | None | None |

1 | 0 | 0 | 0 | 1 | 0 | 3 | 0100 |

2 | 0 | 0 | 1 | 0 | 0 | 1 | 0100 |

3 | 0 | 0 | 1 | 1 | 1 | 3 | 0010 |

4 | 0 | 1 | 0 | 0 | 1 | 2 | 0010 |

5 | 0 | 1 | 0 | 1 | N/A | N/A | N/A |

6 | 0 | 1 | 1 | 0 | 0 | 2 | 0100 |

7 | 0 | 1 | 1 | 1 | 2 | 3 | 1000 |

8 | 1 | 0 | 0 | 0 | 2 | 3 | 1000 |

9 | 1 | 0 | 0 | 1 | 0 | 2 | 0100 |

10 | 1 | 0 | 1 | 0 | N/A | N/A | N/A |

11 | 1 | 0 | 1 | 1 | 1 | 2 | 0010 |

12 | 1 | 1 | 0 | 0 | 1 | 3 | 0010 |

13 | 1 | 1 | 0 | 1 | 0 | 1 | 0100 |

14 | 1 | 1 | 1 | 0 | 0 | 3 | 0100 |

15 | 1 | 1 | 1 | 1 | None | None | None |

Exec. | CS | CB | LB | MS | NLN | SKA05 | SCE2 | KWC | MD |
---|---|---|---|---|---|---|---|---|---|

(sec) | (sec) | (sec) | (sec) | (sec) | (sec) | (sec) | (sec) | (sec) | |

1 | 1.883 | 2.096 | 1.840 | 2.176 | 1.853 | 1.985 | 2.100 | 1.868 | 1.758 |

2 | 1.905 | 2.075 | 1.870 | 2.206 | 1.989 | 1.959 | 2.173 | 1.774 | 1.733 |

3 | 1.914 | 2.069 | 1.871 | 2.177 | 1.873 | 1.986 | 2.160 | 1.870 | 1.765 |

4 | 1.934 | 2.114 | 1.903 | 2.144 | 1.847 | 1.984 | 2.162 | 1.803 | 1.764 |

5 | 1.857 | 2.136 | 1.851 | 2.145 | 1.892 | 1.965 | 2.100 | 1.859 | 1.776 |

6 | 1.817 | 2.085 | 1.869 | 2.174 | 1.838 | 1.994 | 2.132 | 1.825 | 1.814 |

7 | 1.918 | 2.082 | 1.847 | 2.190 | 1.869 | 1.987 | 2.170 | 1.768 | 1.787 |

8 | 1.836 | 2.093 | 1.832 | 2.211 | 1.814 | 2.005 | 2.149 | 1.810 | 1.769 |

9 | 1.820 | 2.136 | 1.921 | 2.175 | 1.805 | 1.971 | 2.144 | 1.828 | 1.757 |

10 | 1.944 | 2.082 | 1.859 | 2.210 | 1.816 | 1.941 | 2.167 | 1.743 | 1.806 |

Avg: | 1.883 | 2.097 | 1.866 | 2.181 | 1.860 | 1.978 | 2.146 | 1.815 | 1.773 |

The MD Algorithm Is % Faster Compared to | |||||||
---|---|---|---|---|---|---|---|

CS | CB | LB | MS | NLN | SKA05 | SCE2 | KWC |

6.20% | 18.27% | 5.27% | 23.01% | 4.89% | 11.55% | 21.03% | 2.36% |

**Table 4.**Average execution time of each algorithm when clipping 10 million lines against convex polygons with different numbers of edges.

Number of Edges | Cyrus–Beck (sec) | Skala 2005 (sec) | S-Clip E2 (sec) | Matthes–Drakopoulos (sec) |
---|---|---|---|---|

5 | 2.443 | 2.443 | 2.425 | 2.358 |

6 | 2.657 | 2.655 | 2.564 | 2.501 |

7 | 2.743 | 2.682 | 2.648 | 2.590 |

8 | 2.860 | 2.859 | 2.686 | 2.632 |

9 | 2.938 | 2.826 | 2.820 | 2.774 |

10 | 3.139 | 3.104 | 2.949 | 2.884 |

Edges | MD Algorithm Is Faster Compared to | ||
---|---|---|---|

Cyrus-Beck | Skala 2005 | S-Clip E2 | |

5 | 3.58% | 3.61% | 2.85% |

6 | 6.21% | 6.16% | 2.50% |

7 | 5.92% | 3.54% | 2.25% |

8 | 8.65% | 8.62% | 2.07% |

9 | 5.90% | 1.87% | 1.65% |

10 | 8.84% | 7.65% | 2.26% |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Matthes, D.; Drakopoulos, V.
Line Clipping in 2D: Overview, Techniques and Algorithms. *J. Imaging* **2022**, *8*, 286.
https://doi.org/10.3390/jimaging8100286

**AMA Style**

Matthes D, Drakopoulos V.
Line Clipping in 2D: Overview, Techniques and Algorithms. *Journal of Imaging*. 2022; 8(10):286.
https://doi.org/10.3390/jimaging8100286

**Chicago/Turabian Style**

Matthes, Dimitrios, and Vasileios Drakopoulos.
2022. "Line Clipping in 2D: Overview, Techniques and Algorithms" *Journal of Imaging* 8, no. 10: 286.
https://doi.org/10.3390/jimaging8100286