2. Cohen Sutherland line clipping algorithm
work on rectangular box, but if we want to
apply clipping algorithm for non- rectangular
box then we use Cyrus back line clipping
algorithm.
Cyrus Beck is a line clipping algorithm that is
made for convex polygons.
It allows line clipping for non-rectangular
windows
3. This algorithm uses one parametric equation and by
using this equation we find the intersecting point of the
line with the boundary of the clipping window.
Parametric equation: let us consider two line end
points P0,P1, then the parametric equation will be:
P(t)=P0+(P1-P0)t 0<=t<=1
if t=0 => P(t)=P0
if t=1 => P(t)=P1
4. In this figure P0 and P1 is a
point of line.
We have to find out the only
visible portion of the line and
exterior potion of the line will be
discarded by using this
algorithm.
For example if we draw a line P0
to P1. and starting time for P0 is
suppose t=0 and time of end
point P1 is t=1.
• In figure the initial value of P0=(-2,1) and P1=(6,3)
• So this algorithm work on the find out the point which
will not be discarded and what was the time of that
point.
P’0,p’1
5. After calculating the time of both point we apply both
value in the below formula and calculating the point
value. means this time value will help to find out the
value of P’0, P’1
Here Ni, N is a normal vector and i= edge no.
Pei= point of edge
P(t) =P0+t(P1-P0) This is a Parametric
Equation
6. Step 1- Firstly we find the exterior point on the edge and
give a name. which is represent in a general way
n(normal vector) which is an edge no.
Figure:
7. Step 2- Now take a point on every edge or a vertex which is
represent by Pe1……Pei (point at edge)
Step 3- After calculating Ni or Pei then by using both value we can
calculate the time for every edge of polygon. For doing things we
use this formula:
Step 4- After calculating time for all edge then by using P0 and P1
and use this time below formula:
and find out the value of Pe0 and P1
P(t) =P0+t(P1-P0 )