Created
February 21, 2015 15:19
-
-
Save ejmurray/801dd3ca7af8c980225a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# encoding: utf-8 | |
""" | |
Description calculate the area of a circle | |
""" | |
import math | |
def distance (x1, y1, x2, y2): | |
dx = x2 - x1 | |
dy = y2 - y1 | |
dsquared = dx**2 + dy**2 | |
result = math.sqrt(dsquared) | |
return result | |
def circle_area(x1, y1, x2, y2): | |
radius = distance(x1, y1, x2, y2): | |
result = area(radius) | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment