0
1.4kviews
Perform clipping on the segments AB, CD and EF using Cohen Sutherland algorithm.

A Rectangular clipping window has lower left corner is at (1,2) and the upper right corner at (9,8). The co-ordinates of the points A,B,C,D,E and F are: (11,6), (11,10), (6,6), (8,9), (2,3) and (8,4) respectively.

Mumbai University > Mechanical Engineering > Sem 7 > CAD CAM CAE

Marks: 10 Marks

Year: Dec 2016

1 Answer
0
2views

enter image description here

Logical AND FOR AB

(0010) AND (1010)0=(0010)

Not zero

$\therefore$ No clipping

Line seg EF both end points have bit code (0000)

$\therefore$ Inside clipping window

Logical AND FOR CD

(0000) AND (1000) = (0000)

$\therefore$ Line need clipping

equation of slope of line CD

$\dfrac{Y_2-Y_1}{X_2-X_1}=\dfrac{9-6}{8-6}=1.5$

Calculation of 'D' for X co-ordinate Y co-ordinate for D'=8 since on window

$\dfrac{8-6}{x-6}=1.5 \\ 2=1.5x-9 \\ x=\boxed{7.33} \\D'=(7.33,8)$

Please log in to add an answer.