Page 77 - DCAP313_LAB_ON_COMPUTER_GRAPHICS
P. 77

Unit 5: Implementing Ellipse Algorithm



               5.  A prediction (xk+1, yk–½) is set at the middle between the four candidate pixels.  Notes
                 (a)  True                       (b)  False

            5.3 Ellipse Area, Sector Area and Segment Area

            The ellipse area, sector area and segment area are defined as follows:

            5.3.1 Ellipse Area
            Consider an ellipse that is cantered at the origin, with its axes aligned to the coordinate axes.
            If the semi-axis length along the x-axis is a and the semi-axis length along the y-axis is B, then
            the ellipse is defined by a locus of points that reassure the implicit polynomial Equation (1a),
            or alternatively defined parametrically as in Equation (1b):
                                   x 2  +  y 2   = 1                                (1a)
                                   A 2  B 2
                                   x =  A◊ cos( )  0  t
                                           t ¸
                                   y =◊ cos( t)  ˝ ££ 2p                            (1b)
                                     B
                                             ˛
            The area of such an ellipse can be found using the parameterized form given in Equation (1b)
            with the Gauss-Green formula:
                                   1  2 t
                            Area =   1 t Ú  [x(t)· y(t) – x(t)· y(t)]dt           (2a)
                                   2
                                   1  2p
                                 =   0 Ú  [A· cost(t)· B· cos(t) – B· sin(t)· (–A)· sin(t)]dt
                                   2
                                                           ◊
                                    ◊
                                   AB  2p                AB   2p
                                 =       [cos ()   2  t dt =   dt                   (2b)
                                            2
                                             t + sin( )]
                                    2  Ú 0                2  Ú 0
                                 =   · A· B                                         (3)
            For  more  general  ellipses,  e.g.,  ellipses  that  have  been  rotated  and/or  translated,  the  area
            determined by Equation (3) is still applicable, provided the semi-axis lengths are known. Other
            methods are also available for calculating ellipse areas.
            5.3.2 Ellipse Sector Area
            The ellipse sector between two points (x 1 , y 1 ) and (x 2 , y 2 ) on the ellipse is the area that is swept
            out by a vector from the origin to the ellipse, beginning at the first point (x 1 , y 1 ), as the vector
            pass through the ellipse in a counter-clockwise direction from (x 1 , y 1 ) to (x 2 , y 2 ). An example is
            shown in Figure. (See Figure 5.1)

                                     Figure 5.1: Ellipse Sector Area






















                                             LOVELY PROFESSIONAL UNIVERSITY                                    71
   72   73   74   75   76   77   78   79   80   81   82