Net migration rate: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
No edit summary
en>Mlinwiki
No edit summary
 
Line 1: Line 1:
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 clipping window. With these intersections it knows which portion of the line should be drawn. This algorithm is significantly more efficient than [[Cohen–Sutherland]].
The author is called Irwin. Supervising is my profession. Years in the past we moved to North Dakota and I adore every working day living here. One of the things she enjoys most is to do aerobics and now she is attempting to earn cash with it.<br><br>Also visit my weblog - [http://Googele.ga/dietmealsdelivered20142 Googele.ga]
 
The idea of the Liang-Barsky clipping algorithm is to do as much testing as possible before computing line intersections.
Consider first the usual parametric form of a straight line:
 
:<math>x = x_0 + u (x_1 - x_0) = x_0 + u \Delta x\,\!</math>
:<math>y = y_0 + u (y_1 - y_0) = y_0 + u \Delta y\,\!</math>
 
A point is in the clip window, if
:<math>x_{\text{min}} \le x_0 + u \Delta x \le x_{\text{max}}\,\!</math>
and
:<math>y_{\text{min}} \le y_0 + u \Delta y \le y_{\text{max}}\,\!</math>,
which can be expressed as the 4 inequalities
:<math>u p_k \le q_k, \quad k = 1, 2, 3, 4\,\!</math>,
where
 
:<math>p_1 = -\Delta x  ,              q_1 = x_0 - x_{\text{min}}\,\!</math> (left)
:<math>p_2 = \Delta x  ,                q_2 = x_{\text{max}} - x_0\,\!</math> (right)
:<math>p_3 = -\Delta y  ,              q_3 = y_0 - y_\text{min}\,\!</math> (bottom)
:<math>p_4 = \Delta y  ,              q_4 = y_\text{max} - y_0\,\!</math> (top)
 
To compute the final line segment:
# A line parallel to a clipping window edge has <math>p_k = 0</math> for that boundary.
# If for that <math>k</math>, <math>q_k < 0</math>, the line is completely outside and can be eliminated.
# When <math>p_k < 0</math> the line proceeds outside to inside the clip window and when <math>p_k > 0</math>, the line proceeds inside to outside.
# For nonzero <math>p_k</math>, <math>u = \frac{q_k}{p_k}</math> gives the intersection point.
# For each line, calculate <math>u_1</math> and <math>u_2</math>. For <math>u_1</math>, look at boundaries for which <math>p_k < 0</math> (outside -> in). Take <math>u_1</math> to be the largest among <math>\left(0,\frac{q_k}{p_k}\right)</math>. For <math>u_2</math>, look at boundaries for which <math>p_k > 0</math> (inside -> out). Take <math>u_2</math> to be the minimum of <math>\left(1, \frac{q_k}{p_k}\right)</math>. If <math>u_1 > u_2</math>, the line is outside and therefore rejected.
 
==See also==
Algorithms used for the same purpose:
* [[Cyrus–Beck]]
* [[Nicholl–Lee–Nicholl]]
* [[Fast-clipping]]
 
==References==
* Liang, Y.D., and Barsky, B., "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, ''Some Improvements to a Parametric Line Clipping Algorithm'', CSD-92-688, Computer Science Division, University of California, Berkeley, 1992.
* James D. Foley. ''[http://books.google.com/books/about/Computer_graphics.html?id=-4ngT05gmAQC Computer graphics: principles and practice]''. Addison-Wesley Professional, 1996. p.&nbsp;117.
 
==External links==
* http://hinjang.com/articles/04.html
 
{{DEFAULTSORT:Liang-Barsky algorithm}}
[[Category:Clipping (computer graphics)]]

Latest revision as of 00:35, 8 November 2014

The author is called Irwin. Supervising is my profession. Years in the past we moved to North Dakota and I adore every working day living here. One of the things she enjoys most is to do aerobics and now she is attempting to earn cash with it.

Also visit my weblog - Googele.ga