Liang–Barsky algorithm: Difference between revisions

Content deleted Content added
Remove direction to the reader.
Tags: Mobile edit Mobile web edit Advanced mobile edit
m Update 1st reference, and found a replacement for 2nd reference's dead link.
Line 1:
{{Short description|Line-clipping algorithm}}
In [[computer graphics]], the '''Liang–Barsky algorithm''' (named after [[You-Dong Liang]] and [[Brian A. Barsky]]) is a [[line clipping]] algorithm. The Liang–Barsky algorithm uses the parametric equation of a line and inequalities describing the range of the clipping window to determine the intersections between the line and the [[clip window]]. With these intersections, it knows which portion of the line should be drawn. So this algorithm is significantly more efficient than [[Cohen–Sutherland]]. The idea of the Liang–Barsky clipping algorithm is to do as much testing as possible before computing line intersections.
 
The algorithm uses the parametric form of a straight line:
Line 158:
 
==References==
* Liang, Y. D., and Barsky, B., "[httphttps://cumincaddl.scixacm.netorg/cgi-bindoi/workspdf/Show?05b410.1145/357332.357333 A New Concept and Method for Line Clipping]", ''ACM Transactions on Graphics'', 3(1):1–22, January 1984.
* Liang, Y. D., B. A., Barsky, and M. Slater, ''[httphttps://wwwwww2.academiaeecs.berkeley.edu/downloadPubs/46463850TechRpts/1992/CSD-92-688.pdf Some Improvements to a Parametric Line Clipping Algorithm]{{dead link|date=July 2022|bot=medic}}{{cbignore|bot=medic}}'', CSD-92-688, Computer Science Division, University of California, Berkeley, 1992.
* James D. Foley. ''[https://books.google.com/books/about/Computer_graphics.html?id=-4ngT05gmAQC Computer graphics: principles and practice]''. Addison-Wesley Professional, 1996. p. 117.