9. Clipping Circle By Accept/Reject Test 1-Scan Conversion of Circles 2-Write Points(x,y) 3-Clipping Circles
10. Midpoint Circle Algorithm Choose E as the next pixel if M lies inside the circle, and SE otherwise. d = d<0: Select E dnew = d + (2xp+3) d>0: Select SE dnew = d + (2xp–2yp+5) E M SE xp xp+1
11. Midpoint Circle Algorithm Start with P (x = 0, y = r). Compute d for the first midpoint at (1, r - ½): d = F(1, r - ½) = 5/4 - r While (x < y) { If (d <= 0) // E is chosen d = d + 2 * x + 3 Else // SE is chosen y = y – 1 d = d + 2 * x – 2 * y + 5 x = x+1; WritePixel (x, y) }
13. Clipping Circles Accept/Reject test – Does bounding box of the circle intersect with clipping box? If yes, condition pixel write on clipping box inside/outside test Also we can test Circle points by Point Clipping . -the point P=(x, y) is display in clipping Boundry if xmin< x <xmaxandymin<y<ymax
14. Curve Clipping Areas with curved boundaries can be clipped with methods similar to those discussed in the previous .sections. Curve-clipping procedures will involve nonlinear equations, however, and this requires more processing than for objects with linear boundaries. The bounding rectangle for a circle or other curved object can be used first to test for overlap with a rectangular clip window. If the bounding rectangle for the object is completely inside the window, we save the object. If the rectangle is determined to be completely outside the window, we discard the object. In either case, there is no further computation necessary. But if the bounding rectangle test fails, we can look for other computation-saving approaches. For a circle, we can use the coordinate extents of individual quadrants and then octants for preliminary testing before calculating curve-window intersections. For an ellipse, we can test the coordinate extents of individual quadrants. Figure blew illustrates circle clipping against a rectangular window.
15. Curve Clipping Similar procedures can be applied when clipping a curved object against a general polygon clip region. On the first pass, we can clip the bounding rectangle of the object against the bounding rectangle of the clip region. If the two regions overlap, we will need to solve the simultaneous line-curve equations to obtain the clipping intersection points.