Node: Querying Ellipses, Next: , Previous: Affine Transformations for Ellipses, Up: Ellipse Reference



Querying

bool is_elliptical (void) const function
Returns true if the Ellipse is elliptical, otherwise false.

Certain transformations, such as shearing and scaling, can cause Ellipses to become non-elliptical.

bool is_quadratic (void) Inline const function
Returns true, because the equation for an ellipse in the x-y plane with its center at the origin is the quadratic equation x^2/a^2 + y^2/b^2 = 1 where a is half the horizontal axis and b is half the vertical axis.
          Ellipse e(origin, 5, 2, 90);
          e.draw();
          Point P(e.angle_point(-35));
          cout << ((P.get_x() * P.get_x())
                   / (e.get_axis_h()/2 * e.get_axis_h()/2))
                  + ((P.get_y() * P.get_y())
                     / (e.get_axis_v()/2 * e.get_axis_v()/2));
          -| 1
          


[Figure 163. Not displayed.]

Fig. 163.

bool is_cubic (void) const virtual functions
bool is_quartic (void)
These functions both return false, because the equation of an ellipse is neither a cubic nor a quartic function.