I say we make circle and ellipse a specialized subclass of squares, but with bendy edges.
>A superellipse, also known as a Lamé curve after Gabriel Lamé, is a geometric figure defined in the Cartesian coordinate system as the set of all points (x y) with (+ (expt (/ x a) n) (expt (/ y b) n)) where n, a and b are positive numbers
>For n = 1 The curve is a rhombus with corners (±a, 0) and (0, ±b).
>For n = 2 the curve is an ordinary ellipse (in particular, a circle if a = b).
[note by me] For n -> inf the curve tends to a rectangle with corners (±a, ±b) (in particular, a square if a = b).
Your new hierarchy would have:
Superellipse <|-- Rectangle
Rectangle <|-- Square
Superellipse <|-- Ellipse
Ellipse <|-- Circle
The circle-ellipse problem is a problem with OOP systems where a superclass has lass strict invariants than a subclass.
If you make circle a subclass of ellipse, how is setWidth and set height on the ellipse class applied to the circle class?
If you make ellipse a subclass of circle, how does the ellipse handle the circle invariant that height is always the same as width?