# L-14.5 MCS 260 Fri 14 Jul 2014 : classcircle

"""
Illustration of inheritance.
"""

from classpoint import Point

class Circle(Point):
    """
    The circle class inherites from Point.
    """

    def __init__(self, a=0, b=0, r=0):
        "the center is (a,b), radius = r"
        Point.__init__(self, a, b)
        self.rad = r

    def __str__(self):
        "returns string representation of a circle"
        prt = 'center : ' + Point.__str__(self) + '\n'
        prt += 'radius : ' + '%.4e' % self.rad
        return prt

    def area(self):
        "returns the area of the circle"
        from math import pi
        return pi*self.rad**2
