# L-26 MCS 260 Fri 11 Mar 2016 : 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
