Page 88 - DCAP313_LAB_ON_COMPUTER_GRAPHICS
P. 88

Lab on Computer Graphics



                   Notes         Equation (12) are found by substituting the expressions for the point (x, y) into a standard ellipse
                                 equation, yielding the following ellipse equation:
                                  [cos(j -  j 1 ) (x TR  -  (h 1  - h 2 )) -  sin(j -  j 1 )(y TR  -  (k 1  - k 2  ))] 2
                                                                    ◊
                                            ◊
                                       2
                                                               2
                                                         A 2 2
                                                    ◊
                                                                            ◊
                                      +   [sin(j -  j 1 ) (x TR  -  (h 2  - h 2  )) -  cos(j -  j 1 )(y TR  - (k 1  - k 2  ))] 2   = 1   (16)
                                                                       2
                                               2
                                                                 B 2 2
                                 Where (x TR , y TR ) are defined in Equation (15). Expanding the terms of Equation (16), and then
                                 simplifying yields expressions for the implicit polynomial coefficients in Equation (12) for a
                                 general ellipse with parameters (A 2 , B 2 , h 2 TR, k 2 TR, φ 2  – φ 1 ):
                                          2
                                                      2
                                        cos(j -  j  )  sin (j -  j  )
                                   AA =      2   1  +    2   1                                           (17a)
                                            A 2 2       B 2 2
                                   BB =   2 ◊sin(j 2  - j 1  ◊ )cos(j 2  - j 1 )  -  2 ◊sin(j 2  - j 1  ◊ )cos(j 2  - j 1 )  (17b)
                                                 A 2 2                   B 2 2
                                          2
                                                      2
                                   CC =   sin(j -  j 1 )  +  cos (j -  j 1 )                             (17c)
                                             2
                                                         2
                                            A 2 2       B 2 2
                                        -◊ cos(j  - j  ◊ )[h  ◊ cos(j  - j  )  + k  ◊sin(j  - j  )]
                                         2
                                   DD =        2   1  2 TR    2  1   2TR     2  1  +
                                                            A 2 2
                                                           -◊sin(j  - j  ◊ )[k  ◊ cos(j  - j  ) - h  ◊sin(j  - j  )]
                                                            2
                                                                  2  1   2 TR   2   1   2 TR   2   1     (17d)
                                                                               B 2 2
                                         2
                                        -◊sin(j  - j  ◊ )[h  ◊ cos(j  - j  )  - k  ◊sin(j  - j  )]
                                   EE =        2  1   2 TR    2  1   2TR    2   1  +
                                                            A 2
                                                             2
                                                             2◊cos(j  - j  ◊ )[h  ◊ sin(j  - j  ) - k  ◊cos(j  - j  )]
                                                                    2  1   2 TR   2   1   2 TR   2   1    (17e)
                                                                                 B 2 2
                                        [h  ◊ cos(j  - j  ) -  k  ◊ sin(j  - j  )] 2  [h  ◊ sin(j  - j  ) - k  ◊cos(j  - j  )] 2
                                   FF =   2 TR   2  1   2 TR   2   1  +  2 TR   2   1   2 TR R  2  1  – 1  (17f)
                                                      A 2 2                           B 2 2
                                 Intersection points are found by solving simultaneously the two implicit polynomials denoted
                                 above as Equation (11) and Equation (12). Solving for x in Equation (11):
                                               x 2  y 2             2  Ê  y 2  ˆ
                                                  +    = 1   x =  ± A 1  ◊ 1  -  ˜                       (18)
                                                                      Á
                                               A 2  B 2               Ë   B 2  ¯
                                                1   1                      1
                                 Substituting the expressions for x of Equation (18) into Equation (12), where the coefficients are
                                 defined in Equation (17) yields a quadratic polynomial in y. substituting either the positive or
                                 the negative root gives the same quadratic polynomial coefficients, which are:
                                      cy[4]  y  + cy[3]  y  + cy[2]  y  + cy[1]  y  + cy[0] = 0       (19)
                                                        3
                                                                2
                                                                         1
                                               4
                                 where:
                                        cy[]
                                           4
                                                                             )
                                                                                2
                                                                                 ◊
                                                                                     2
                                                                  2
                                                             2
                                                                     2
                                                                          ◊
                                                         2
                                              =  A ◊  AA +  B ◊ È A ◊( BB -◊  AACC +  B CC ˘
                                                 4
                                                      2
                                                         1 Î
                                                                                      ˚
                                          B 1    1           1                  1
                                        cy[]
                                           3
                                                                                  ˘
                                                                   (
                                                    ◊ ÈB CC EE
                                                                               ◊
                                                                      ◊
                                              =  2 ◊ B 1 Î  2 1  ◊  ◊  + A 2 1  ◊ BBDD  - AAEE)
                                                                                  ˚
                                         B 1
                                        cy[]     2    2             2     2                2    2   2
                                           2
                                                                             2
                                                             ◊
                                                                                        2
                                                                     )
                                                                                  ◊
                                              =  A ◊ È { Î B ◊( 2 ◊ AA CC - BB + DD -◊ AA FF˘ -◊ A ◊ AA } + B 1
                                                                                     ˚
                                                 1
                                                                                           1
                                                      1
                                          B 1
                                                                                                            2
                                                                                               (2  CC  FF + EE )
                                         cy[]
                                           1
                                                    ◊ ÈA
                                                                               ˘
                                                                   ◊
                                                            ◊
                                                         (
                                                                            ◊
                                              =  2 ◊ B 1 Î  1 2  ◊ AA EE  - BB DD)  + EE FF
                                                                               ˚
                                          B 1
                                           0
                                        cy[]
                                                      ◊
                                                              )
                                                                       ◊
                                                                               )
                                                                   ˚
                                              =  Î È A ◊( A AA - DD + FF˘◊[ AAA + DD + FF]
                                                     1
                                                                      1
                                                  1
                                         B 1
        82                                LOVELY PROFESSIONAL UNIVERSITY
   83   84   85   86   87   88   89   90   91   92   93