# Liang-Barsky Line Clipping Algorithm with C/C++

Theory
In Liang-Barsky algorithm, we first write the point-clipping conditions in parametric form as

Each of these for inequalities can be expressed as , k = 1, 2, 3, …..
where parameter p and q are defined as