circle & ellipse relationship

Discussion in 'C' started by vql, Sep 27, 2007.

  1. vql

    vql New Member

    Joined:
    Sep 27, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    There are alot ideas about the relationship between circle & ellipse. And I don't know I should design class circle inherit from class ellipse or ellipse inherit from circle. Please give me some suggests, and clues. Thanks alot.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,345
    Likes Received:
    382
    Trophy Points:
    83
    I think the following statement should make your relationship clear

    Circle is a kind of ellipse where Major axis and minor axis are same ( as radius ).

    But remember that there is not a "is a" relationship between the two but just a kind of relationship between them.
     
  3. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    http://www.daweidesigns.com
    A circle is a kind of ellipse, so the elliplse would be the parent. The circle would be a child with the minor and major axes having the same value (a specialization). You could not specialize a circle to be any possible ellipse, because if you changed one axis, it would not be a circle (or a child of a circle).
     
  4. vql

    vql New Member

    Joined:
    Sep 27, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    That it mean: Circle is child & Ellipse is Parent?
    But I read Java APIs. It doesn't distinguish Ellipse & Circle. Java only have class Ellipse2D, not have class Circle2D.

    According to you, if you are a designer. You have a class Ellipse, and will you create a class Circle inherit from Ellipse or not?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice