Computer Science, asked by priyanka2762, 11 months ago

consider a rectangular window whose with (Xmin,Ymin)=(-3,4) and (Xmax,Ymax)=(4,3) the region codes of the endpoint of lines using Cohen Sutherland line clipping algorithm line A(-3,4) ,B(-1,-1) , line(2,3) D(5,5)​

Answers

Answered by topwriters
0

Cohen Sutherland line clipping algorithm

Explanation:

Input : Rectangular area of interest (Defined by

       below four values which are coordinates of

       bottom left and top right)

       x_min = 4, y_min = 4, x_max = 10, y_max = 8

     

       A set of lines (Defined by two corner coordinates)

       line 1 : x1 = 5, y1 = 5, x2 = 7, y2 = 7

       Line 2 : x1 = 7, y1 = 9, x2 = 11, y2 = 4

       Line 2 : x1 = 1, y1 = 5, x2 = 4, y2 = 1

Output : Line 1 : Accepted from (5, 5) to (7, 7)

        Line 2 : Accepted from (7.8, 8) to (10, 5.25)

        Line 3 : Rejected

Similar questions