<s>
In	O
computer	O
graphics	O
,	O
line	B-Algorithm
clipping	I-Algorithm
is	O
the	O
process	O
of	O
removing	O
(	O
clipping	B-Algorithm
)	O
lines	O
or	O
portions	O
of	O
lines	O
outside	O
an	O
area	O
of	O
interest	O
(	O
a	O
viewport	O
or	O
view	B-General_Concept
volume	I-General_Concept
)	O
.	O
</s>
<s>
There	O
are	O
two	O
common	O
algorithms	O
for	O
line	B-Algorithm
clipping	I-Algorithm
:	O
Cohen	B-Algorithm
–	I-Algorithm
Sutherland	I-Algorithm
and	O
Liang	B-Algorithm
–	I-Algorithm
Barsky	I-Algorithm
.	O
</s>
<s>
A	O
line-clipping	B-Algorithm
method	O
consists	O
of	O
various	O
parts	O
.	O
</s>
<s>
Then	O
,	O
intersection	B-Algorithm
calculations	O
are	O
carried	O
out	O
with	O
one	O
or	O
more	O
clipping	B-Algorithm
boundaries	O
.	O
</s>
<s>
Determining	O
which	O
portion	O
of	O
the	O
line	O
is	O
inside	O
or	O
outside	O
of	O
the	O
clipping	B-Algorithm
volume	O
is	O
done	O
by	O
processing	O
the	O
endpoints	O
of	O
the	O
line	O
with	O
regards	O
to	O
the	O
intersection	B-Algorithm
.	O
</s>
<s>
In	O
computer	O
graphics	O
,	O
the	O
Cohen	B-Algorithm
–	I-Algorithm
Sutherland	I-Algorithm
algorithm	I-Algorithm
(	O
named	O
after	O
Danny	O
Cohen	O
and	O
Ivan	O
Sutherland	O
)	O
is	O
a	O
line-clipping	B-Algorithm
algorithm	O
.	O
</s>
<s>
In	O
1967	O
,	O
flight-simulation	O
work	O
by	O
Danny	O
Cohen	O
led	O
to	O
the	O
development	O
of	O
the	O
Cohen	B-Algorithm
–	I-Algorithm
Sutherland	I-Algorithm
computer	O
graphics	O
two	O
-	O
and	O
three-dimensional	O
line	B-Algorithm
clipping	I-Algorithm
algorithms	O
,	O
created	O
with	O
Ivan	O
Sutherland	O
.	O
</s>
<s>
The	O
Liang	B-Algorithm
–	I-Algorithm
Barsky	I-Algorithm
algorithm	I-Algorithm
uses	O
the	O
parametric	O
equation	O
of	O
a	O
line	O
and	O
inequalities	O
describing	O
the	O
range	O
of	O
the	O
clipping	B-Algorithm
box	O
to	O
determine	O
the	O
intersections	B-Algorithm
between	O
the	O
line	O
and	O
the	O
clipping	B-Algorithm
box	O
.	O
</s>
<s>
With	O
these	O
intersections	B-Algorithm
it	O
knows	O
which	O
portion	O
of	O
the	O
line	O
should	O
be	O
drawn	O
.	O
</s>
<s>
This	O
algorithm	O
is	O
significantly	O
more	O
efficient	O
than	O
Cohen	B-Algorithm
–	I-Algorithm
Sutherland	I-Algorithm
,	O
but	O
Cohen	B-Algorithm
–	I-Algorithm
Sutherland	I-Algorithm
does	O
trivial	O
accepts	O
and	O
rejects	O
much	O
faster	O
,	O
so	O
it	O
should	O
be	O
considered	O
instead	O
if	O
most	O
of	O
the	O
lines	O
you	O
need	O
to	O
clip	O
would	O
be	O
completely	O
in	O
or	O
out	O
of	O
the	O
clip	O
window	O
.	O
</s>
<s>
Very	O
similar	O
to	O
Liang	B-Algorithm
–	I-Algorithm
Barsky	I-Algorithm
line-clipping	B-Algorithm
algorithm	O
.	O
</s>
<s>
The	O
difference	O
is	O
that	O
Liang	B-Algorithm
–	I-Algorithm
Barsky	I-Algorithm
is	O
a	O
simplified	O
Cyrus	O
–	O
Beck	O
variation	O
that	O
was	O
optimized	O
for	O
a	O
rectangular	O
clip	O
window	O
.	O
</s>
<s>
The	O
Cyrus	O
–	O
Beck	O
algorithm	O
is	O
primarily	O
intended	O
for	O
a	O
clipping	B-Algorithm
a	O
line	O
in	O
the	O
parametric	O
form	O
against	O
a	O
convex	O
polygon	O
in	O
2	O
dimensions	O
or	O
against	O
a	O
convex	O
polyhedron	O
in	O
3	O
dimensions	O
.	O
</s>
<s>
The	O
Nicholl	O
–	O
Lee	O
–	O
Nicholl	O
algorithm	O
is	O
a	O
fast	O
line-clipping	B-Algorithm
algorithm	O
that	O
reduces	O
the	O
chances	O
of	O
clipping	B-Algorithm
a	O
single	O
line	O
segment	O
multiple	O
times	O
,	O
as	O
may	O
happen	O
in	O
the	O
Cohen	B-Algorithm
–	I-Algorithm
Sutherland	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
The	O
clipping	B-Algorithm
window	O
is	O
divided	O
into	O
a	O
number	O
of	O
different	O
areas	O
,	O
depending	O
on	O
the	O
position	O
of	O
the	O
initial	O
point	O
of	O
the	O
line	O
to	O
be	O
clipped	O
.	O
</s>
<s>
This	O
algorithm	O
has	O
similarities	O
with	O
Cohen	B-Algorithm
–	I-Algorithm
Sutherland	I-Algorithm
.	O
</s>
<s>
In	O
contrast	O
,	O
Cohen	B-Algorithm
–	I-Algorithm
Sutherland	I-Algorithm
may	O
have	O
to	O
iterate	O
several	O
times	O
to	O
handle	O
the	O
same	O
case	O
.	O
</s>
<s>
It	O
can	O
be	O
used	O
for	O
line	O
or	O
line-segment	O
clipping	B-Algorithm
against	O
a	O
rectangular	O
window	O
,	O
as	O
well	O
as	O
against	O
a	O
convex	O
polygon	O
.	O
</s>
<s>
The	O
algorithm	O
is	O
based	O
on	O
classifying	O
a	O
vertex	O
of	O
the	O
clipping	B-Algorithm
window	O
against	O
a	O
half-space	O
given	O
by	O
a	O
line	O
p	O
:	O
ax	O
+	O
by	O
+	O
c	O
=	O
0	O
.	O
</s>
