The Liang-Barsky line clipping algorithm uses the parametric equation of a line from $(x_{1} , y_{1} )$ to $(x_{2} , y_{2} )$ along with its infinite extension which is given as :
$x = x_{1} + \Delta x.u$
$y = y_{1} + \Delta y.u$
Where $\Delta x = x_{2} – x_{1} , \Delta y = y_{2} – y_{1}$, and $u$ is the parameter with $0 \leq u \leq 1$. A line $AB$ with end points $A(–1, 7)$ and $B(11, 1)$ is to be clipped against a rectangular window with $x_{min} = 1, x_{max} = 9, y_{min} = 2$, and $y_{max} = 8$. The lower and upper bound values of the parameter u for the clipped line using Liang-Barsky algorithm is given as :
- $(0, \frac{2}{3})$
- $\left(\frac{1}{6},\frac{5}{6}\right)$
- $(0, \frac{1}{3})$
- $(0, 1)$