Page 42 - Computer Graphics
P. 42

41

               Ellipse Algorithm


               Properties of ellipse

               Ellipse is defined as the locus of a point in a plane which moves in a plane in such
               a manner that the ratio of its distance from a fixed point called focus in the same

               plane to its distance from a fixed straight line called directrix is always constant,
               which should always be less than unity.

               If  the  distance  to  the  two  foci  from  any  point P=(x,y) on  the  ellipse  are
               labeled d1 and d2 then  the  general  equation  of  the  ellipse  can  be  stated
               as- d1+d2=constant.


               For expressing the distances d1 and d2 in terms of focal coordinates F1 and F2 we
                                2
               have:- Ax +By +Cxy+Dx+Ey+F=0 where A, B, C, D,E, and F are evaluated in
                           2
               terms of focal coordinates and dimensions of the major and minor axes of the
               ellipse.


               Midpoint ellipse algorithm

               The midpoint ellipse method is applied throughout the first quadrant in two
               parts. Now let us take the start position at (0,ry) and step along the ellipse path in
               clockwise order throughout the first quadrant.


               Ellipse function can be defined as:

                              2 2
                                               2
                                           2
                                     2 2
               fellipse(x,y)=ry x +rx y -rx ry
               According to this there are some properties which have been generated that are:
                   1.  fellipse(x,y)<0 which means (x,y) is inside the ellipse boundary.

                   2.  fellipse(x,y)>0 which means (x,y) is outside the ellipse boundary.

                   3.  fellipse(x,y)=0 which means (x,y) is on the ellipse boundary.








                                                 (-x,y)                   (x,y)








                                                   (-x,-y)          (x,-y)
   37   38   39   40   41   42   43   44   45   46   47