[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/learnbyexample/ThinkRubyBuild/master/code/Circle.py [Back]  [Original]

"""This module contains a code example related to

Think Python, 2nd Edition
by Allen Downey
http://thinkpython2.com

Copyright 2015 Allen Downey

License: http://creativecommons.org/licenses/by/4.0/
"""

from __future__ import print_function, division

import copy

from Point1 import Point, Rectangle, print_point
from Point1_soln import distance_between_points


class Circle:
    """Represents a circle.

    Attributes: center, radius
    """


def point_in_circle(point, circle):
    """Checks whether a point lies inside a circle (or on the boundary).

    point: Point object
    circle: Circle object
    """
    d = distance_between_points(point, circle.center)
    print(d)
    return d 

Web Proxy Viewer  |  New URL  |  Original Page