Professional Documents
Culture Documents
Group members
1.20/03829-Ondima Yobes
graphics. It utilizes the parametric equation of a line and inequalities that describe the range
of the clipping window to determine the intersections between the line and the clip window.
1. Parametric Line Equation: The algorithm starts with the parametric form of
a line segment between two points ( P_1(x1, y1) ) and ( P2(x2, y2) ): [ X = x1
0 to 1.
( xwmin, xwmax, ywmin, ywmax ). The algorithm checks the line against
values, ( pk ) and ( qk ), which are derived from the line’s direction and the
clipping window’s boundaries. These values are used to find the parameter ( t )
the line segment is inside the clipping window. If ( t1 ) and ( t2 ) are the
5. Clipping the Line: If the line is found to be partially or completely within the
clipping window, the algorithm calculates the new endpoints of the clipped
6. Drawing the Line: Finally, the clipped line segment is drawn within the
clipping window.
2. Let P1(-1, -2) and P2(2,4) be end points of a line to be clipped using Liang
(YB) = 0 and Top boundary (YT) = 1. Clip the line. Show computations.